ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trying to select the visible range of cells (https://www.excelbanter.com/excel-programming/289904-trying-select-visible-range-cells.html)

Selector

Trying to select the visible range of cells
 
I am trying to select a visible range of cells within a certain selection, but I'm getting a lot of errors.
Also, I need to allow for when the selection already contains visible cells only. My failing code is:

Range(strTitleRange).VisibleRange.Select

Could you please supply your example code to fix these issues?

TIA

Tom Ogilvy

Trying to select the visible range of cells
 
VisibleRange pertains to what can be seen on the screen and is a property of
the window object, not the range object.

Dim rng as Range
set rng = Intersect(Range(strTitleRange),Activewindow.Visibl eRange)
if not rng is nothing then
rng.Select
End if

--
Regards,
Tom Ogilvy

Selector wrote in message
...
I am trying to select a visible range of cells within a certain selection,

but I'm getting a lot of errors.
Also, I need to allow for when the selection already contains visible

cells only. My failing code is:

Range(strTitleRange).VisibleRange.Select

Could you please supply your example code to fix these issues?

TIA





All times are GMT +1. The time now is 07:17 AM.

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