How do you tell excel
to use a variable for the rows selection?
Sorry, I don't quite understand what you mean,
but maybe something like this ?
The code above will select the rows as many as the value in EndTenInput starting from cell A162.
If the EndTenInput value is 16, then it will select the rows from A162 to A177 ---> 16 rows.
If the EndTenInput value is 5, then it will select the rows from A162 to A166---> 5 rows.
But Range("A162") in the code is hardcoded, not a variable.
Alternative way :
The above code will select 17 rows starting from A162 to A178.
If you want it select the rows as many as the value of EndTenInput (for example EndTenInput value is 16),
then you need to subtract the offset EndTenInput by 1 :
The above code will select 16 rows starting from A162 to A177.
But again, Range("A162") in the code is hardcoded, not a variable.
Bookmarks