A ROWS by any other name...

  • Thread starter Thread starter Gary''s Student
  • Start date Start date
G

Gary''s Student

I would like to select several rows in one shot

Rows("1:3").Select works just fine to select
rows 1 thru 3
Rows("1,3,7").Select fails to select the three
required rows
Range("A1,A3,A7").EntireRow.Select works, but looks a little clumsy
 
Just as unwieldy, but what I use

Union(Rows(1), Rows(3), Rows(5)).Select
 
Don't know why the Rows("1, 3, 5") don't work. It allows Union(Rows(1),
Rows(2), Rows(3)) or as you pointed out, you can specify a range of cells
with EntireRow and it will acknowledge the selection. The type mismatch is a
clue, but I am not smart enough to interpret what it really means.
 
P.S. the fact that Rows is a property that can return a range object rather
than being a range object might have something to do with it.
 
Here is a way to do that...

Range("1:1,3:3,7:7").Select

Note the number-colon-number ranges.
 

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

Similar Threads


Back
Top