VBA Code for selecting row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok I know how to write the code for selecting a row. Here is an example:
Rows("8:27").Select

What if instead of the number i want to use vairables such as:
Rows("x:y").Select

Can anyone tell me how to do this? If you can please email
(e-mail address removed)
 
Just some other options:

Sub Demo()
Dim x, y
x = 3
y = 10
Range(Rows(x), Rows(y)).Select
' or
Rows(x).Resize(y - x + 1).Select
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

Back
Top