Defining a range in Excel VBA

This simple vba code will define a range called myRange and set the variable equal to the current cell selected. I like to place this code at the beginning of user activated macros and re-select the range at the end of the macro. This way when a user clicks a marco button, the cursor is returned to the original cell that was selected.

Sub How_To_Define_A_Range_In_VBA()

Dim myRange As Range      ‘declares variable

Set myRange = Range(ActiveCell, ActiveCell)      ‘Sets range equal to the current cell. This can also be modified to use a named range or other range.

myRange.Select  ‘selects the range defined above   

End Sub