Where am I ?

  • Thread starter Thread starter Gary''s Student
  • Start date Start date
G

Gary''s Student

Given that the user has arbitrarily scrolled up and down and right and left,
what is the address of the top, leftmost cell ? That is, the first visible
cell in the Excel window ?
 
I think this is what you want...

TopRow = ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollRow
LeftCol = ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollColumn

While you can get any pane's scrolled row/column, I assumed that, if there
were one or more split panes, you would want the right, bottom or
right-bottom most one (hence the reference to the Count property).

Rick
 
I guess, in light of the other posts, if you wanted the address of the
top/left cell in the bottom, right or bottom-right most pane (when there is
one or more panes showing), you could use this...

TopLeftCellAddress = Split(ActiveWindow.Panes(ActiveWindow.Panes.Count)._
VisibleRange.Address, ":")(0)

Rick
 
Thanks again
--
Gary''s Student - gsnu200781


Rick Rothstein (MVP - VB) said:
I think this is what you want...

TopRow = ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollRow
LeftCol = ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollColumn

While you can get any pane's scrolled row/column, I assumed that, if there
were one or more split panes, you would want the right, bottom or
right-bottom most one (hence the reference to the Count property).

Rick
 

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