ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A ROWS by any other name... (https://www.excelbanter.com/excel-programming/421238-rows-any-other-name.html)

Gary''s Student

A ROWS by any other name...
 
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
--
Gary''s Student - gsnu200820

Jarek Kujawa[_2_]

A ROWS by any other name...
 
Range("1:3").Select

?

;-)

On 12 Gru, 17:32, Gary''s Student
wrote:
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
--
Gary''s Student - gsnu200820



Bob Phillips[_3_]

A ROWS by any other name...
 
Just as unwieldy, but what I use

Union(Rows(1), Rows(3), Rows(5)).Select


--
__________________________________
HTH

Bob

"Gary''s Student" wrote in message
...
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
--
Gary''s Student - gsnu200820




JLGWhiz

A ROWS by any other name...
 
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.

"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200820


JLGWhiz

A ROWS by any other name...
 
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.

"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200820


Rick Rothstein

A ROWS by any other name...
 
Here is a way to do that...

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

Note the number-colon-number ranges.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
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
--
Gary''s Student - gsnu200820




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

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