ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Variable Rows (https://www.excelbanter.com/excel-programming/301817-selecting-variable-rows.html)

Matt D.

Selecting Variable Rows
 
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.

Ron de Bruin

Selecting Variable Rows
 
Hi Matt

Try this

Rows(X & ":" & Y).Select


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Matt D." wrote in message ...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.




Tom Ogilvy

Selecting Variable Rows
 
X = X + 95
Y = Y + 95
Rows(X & ":" & Y).Select

--
Regards,
Tom Ogilvy

"Matt D." wrote in message
...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.




Dana DeLouis[_3_]

Selecting Variable Rows
 
Just two other ideas. If X is always less than Y:
Rows(X).Resize(Y - X + 1).Select

If not, than another idea:
Range(Cells(X, 1), Cells(Y, 1)).EntireRow.Select

Dana DeLouis

"Matt D." wrote in message
...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.





All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com