ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a row with a variable ? (https://www.excelbanter.com/excel-programming/295516-selecting-row-variable.html)

Blewyn[_6_]

Selecting a row with a variable ?
 
How do I select an entire row by using a variable to store the row
number ? I currently have a statement which selects a range :

Range(Cells(Count, 1), Cells(Count, 16)).Select

but I'd like to select the entire row (row number is Count) instead...

Any ideas ?

Thanks,

Blewyn


---
Message posted from http://www.ExcelForum.com/


Bob Phillips[_6_]

Selecting a row with a variable ?
 
Range(Cells(Count, 1), Cells(Count, 16)).Entirerow.Select

or even

Cells(Count, 1).EntireRow.Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Blewyn " wrote in message
...
How do I select an entire row by using a variable to store the row
number ? I currently have a statement which selects a range :

Range(Cells(Count, 1), Cells(Count, 16)).Select

but I'd like to select the entire row (row number is Count) instead...

Any ideas ?

Thanks,

Blewyn


---
Message posted from http://www.ExcelForum.com/




Rob van Gelder[_4_]

Selecting a row with a variable ?
 
I think you're looking for EntireRow
eg.
Cells(Count, 1).EntireRow.Select

But a quicker way:
Rows(Count).Select

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Blewyn " wrote in message
...
How do I select an entire row by using a variable to store the row
number ? I currently have a statement which selects a range :

Range(Cells(Count, 1), Cells(Count, 16)).Select

but I'd like to select the entire row (row number is Count) instead...

Any ideas ?

Thanks,

Blewyn


---
Message posted from http://www.ExcelForum.com/




Blewyn[_7_]

Selecting a row with a variable ?
 
Great, thanks

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:08 PM.

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