Trying to select the visible range of cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.VisibleRange)
if not rng is nothing then
rng.Select
End if

--
Regards,
Tom Ogilvy

Selector said:
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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top