ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select through last non blank row in a column (https://www.excelbanter.com/excel-programming/289628-select-through-last-non-blank-row-column.html)

eric

Select through last non blank row in a column
 
I am trying to get a range from b18 down to the last cell in the column - I thought this would do it based on my recording of a macro but I end up with b1:b65535 - any suggestions

Range("B18", "B65535").Selec
Range(selection, selection.End(xlUp)).Selec

Also I presume I can prefix the ranges with a worksheets object correct

May the worksheet be hidden during the selection

Thanks as usual.

Bob Phillips[_6_]

Select through last non blank row in a column
 
ERic,

Try

Range("B18",Cells(Rows.Count,"B").End(xlUp)).Selec t

--

HTH

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

"eric" wrote in message
...
I am trying to get a range from b18 down to the last cell in the column -

I thought this would do it based on my recording of a macro but I end up
with b1:b65535 - any suggestions?


Range("B18", "B65535").Select
Range(selection, selection.End(xlUp)).Select


Also I presume I can prefix the ranges with a worksheets object correct?

May the worksheet be hidden during the selection?

Thanks as usual.





All times are GMT +1. The time now is 04:41 PM.

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