How to determine whether Cell is in current view?

J

Joe HM

Hello -

I would like to figure out if a certain cell is currently shown in the
current view. For instance, the excel window only displays rows 20-30
and the desired cell is in row 40 then I want to use a
ActiveWindow.ScrollRow = 40 command to make it visible.

I realize that I could just call .Select on the cell but I don't want
to move the current selection.

I found the ActiveWindow.VisibleRange function but how can I determine
from that information whether a certain cell is in the visible range?

Thanks!
Joe
 
G

Guest

if Intersect(ActiveWindow.VisibleRange,Range("A40")) is nothing then
'not in view
Activewindow.ScrollRow = 35
end if
 
J

Joe HM

Hello -

Thanks a lot for help! I guess I did not know there was an Intersect()
function ... but that will come in handy in other cases as well!

Joe
 

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

Top