Need to return to display

O

Otto Moehrbach

Excel XP & Win XP
I wrote a large program for an OP in which, among other things, a specific
range is chosen, from many, to be displayed on the screen. I use the code:
With ActiveWindow
.ScrollRow = y
.ScrollColumn = x
End With
to position the specific range on the screen. The x and y values, of
course, are peculiar to the range chosen.
I now need to code a return to the last selected display. Note that the
display has changed since the user made his last selection as a result of
actions he took with the selected display. I can do this easily if I can
capture the cell address of the top left cell before he does things that
force a display change.
I realize that I can capture that cell address at the time the range
selection is made, but that would mean code changes to many pieces of code.
My question: Can I capture the cell or cell address of the top left cell on
the screen, and if so, how? Thanks for your time. Otto
 
R

Rick Rothstein

I think you can get the top row using this...

TopRow = ActiveWindow.ActivePane.ScrollRow

and the left column using this...

LeftColumn = ActiveWindow.ActivePane.ScrollColumn
 
G

Gary''s Student

Sub dural()
Set myVis = ActiveWindow.VisibleRange(1)
MsgBox (myVis.Address)
End Sub
 

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