Select rows using a variable

J

jnasr00

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?
 
G

Gary Keramidas

try this example

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top