Sep 18 2020 10:02 PM
I am using MACRO in Excel.
In the syntax, Rows("3:3").Select, Can I replace "3:3" with a formula?
Please help!
Sep 18 2020 11:01 PM
@michaelho666 Create a variable that holds the row number you want to select, e.g. "RowToSelect". Then use this code in VBA:
Rows(RowToSelect & ":" & RowToSelect).Select
Sep 19 2020 03:22 AM - edited Sep 19 2020 03:29 AM
@michaelho666 ,,,
This is the best and easiest method you can use.
Dim X As String, Y As String
X = 7
Y = 11
Rows(X & ":" & Y).Select
or to select multiple rows you may use this one.
Sub testRowselect()
Dim SLROW As Range
Set SLROW = Range("A1:A20")
SLROW.Select
End Sub