I'm looking for a macro which can be run to select a consistent range of cells so that I can easily copy them to another spreadsheet. The range would be F3:BJ3.
Thanks for your help.
nlh
I'm looking for a macro which can be run to select a consistent range of cells so that I can easily copy them to another spreadsheet. The range would be F3:BJ3.
Thanks for your help.
nlh
This should do the trick:
Public Sub selectCells()
Range("F3:BJ3").Select
End Sub
edit: for that matter, you can use the following to actually perform the 'copy' command for you as well:
Public Sub selectCellsAndCopy()
Range("F3:BJ3").Select
Selection.Copy
End Sub
What if the range of cells is stored in a variable? E.g. - here if "F3:BJ3" is stored in a variable, how can we pass that variable to range? In my case, refer the following -
tmp_str = "B" & Setup_StartRow & ":B" & Setup_LastRow Range(tmp_str).Select
If I do this, I am getting a Run-Time error - 1004. Please advise how to address this issue!