ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ROWS Property question (https://www.excelbanter.com/excel-programming/310363-rows-property-question.html)

TC[_6_]

ROWS Property question
 
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

Norman Jones

ROWS Property question
 
Hi TC,

Try:

Worksheets("Sheet1"). Range("5:5,3:3,1:1").Select


---
Regards,
Norman



"TC" wrote in message
...
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




Dave Peterson[_3_]

ROWS Property question
 
One way:
Worksheets("sheet1").Range("a5,a3,a1").EntireRow.S elect

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

And you can do most things without changing the selection.


TC wrote:

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


--

Dave Peterson


Norman Jones

ROWS Property question
 
Hi TC,

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

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

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi TC,

Try:

Worksheets("Sheet1"). Range("5:5,3:3,1:1").Select


---
Regards,
Norman



"TC" wrote in message
...
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






TC[_6_]

ROWS Property question
 
Thanks Norman

Tim

On Sat, 18 Sep 2004 00:09:46 +0100, "Norman Jones"
wrote:

Hi TC,

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

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

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi TC,

Try:

Worksheets("Sheet1"). Range("5:5,3:3,1:1").Select


---
Regards,
Norman



"TC" wrote in message
...
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







All times are GMT +1. The time now is 07:24 PM.

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