ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select rows using a variable (https://www.excelbanter.com/excel-programming/344716-select-rows-using-variable.html)

jnasr00[_2_]

Select rows using a variable
 

Hey guys I am trying to store a row number into a variable and then use
those variables to select a range. For example:

Rows("x:y").Select

It doesn't allow me to do this, is there another way?


--
jnasr00
------------------------------------------------------------------------
jnasr00's Profile: http://www.excelforum.com/member.php...o&userid=28515
View this thread: http://www.excelforum.com/showthread...hreadid=482118


Gary Keramidas

Select rows using a variable
 
try this example

Sub test()
x = 4
y = 7
Range(Rows(x), Rows(y)).Delete
End Sub

--


Gary


"jnasr00" wrote in
message ...

Hey guys I am trying to store a row number into a variable and then use
those variables to select a range. For example:

Rows("x:y").Select

It doesn't allow me to do this, is there another way?


--
jnasr00
------------------------------------------------------------------------
jnasr00's Profile:
http://www.excelforum.com/member.php...o&userid=28515
View this thread: http://www.excelforum.com/showthread...hreadid=482118





All times are GMT +1. The time now is 01:40 PM.

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