How to write an Excel macro to select a group of cells?

I'm looking for a macro that can be run to select a consistent range of cells so that I can easily copy them to another table. The range would be F3: BJ3.

+1


source to share


2 answers


This should do the trick:

Public Sub selectCells()
    Range("F3:BJ3").Select
End Sub
      



edit:, for this you can use the following to execute the "copy" command:

Public Sub selectCellsAndCopy()
    Range("F3:BJ3").Select
    Selection.Copy
End Sub
      

+3


source


Use this one, it works fine.



Sub On_Click()
    ActiveSheet.Range("A1:E1").Select
End Sub

      

-1


source







All Articles