ROWS Property question

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

The following works:
Worksheets("Sheet1").Rows(5).Select

But if I want to select multiple nonadjacent rows how can I do that?
Worksheets("Sheet1").Rows(5,3,1).Select gives an error, quotes don't
work.
I could do this with Range but I'm curious if its possible with Rows.
Thanks for the help
 
One way:
Worksheets("sheet1").Range("a5,a3,a1").EntireRow.Select

Remember that you have to be on Sheet1 to select a range on sheet1.

And you can do most things without changing the selection.
 
Hi TC,

Using the Rows property (which I didn't):

With Sheets("Sheet1")
.Activate
Union(.Rows(5), .Rows(3), .Rows(1)).Select
End With
 
Thanks Norman

Tim

Hi TC,

Using the Rows property (which I didn't):

With Sheets("Sheet1")
.Activate
Union(.Rows(5), .Rows(3), .Rows(1)).Select
End With
 

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