ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need to return to display (https://www.excelbanter.com/excel-programming/426555-need-return-display.html)

Otto Moehrbach[_2_]

Need to return to display
 
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



Rick Rothstein

Need to return to display
 
I think you can get the top row using this...

TopRow = ActiveWindow.ActivePane.ScrollRow

and the left column using this...

LeftColumn = ActiveWindow.ActivePane.ScrollColumn

--
Rick (MVP - Excel)


"Otto Moehrbach" wrote in message
...
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



Gary''s Student

Need to return to display
 
Sub dural()
Set myVis = ActiveWindow.VisibleRange(1)
MsgBox (myVis.Address)
End Sub

--
Gary''s Student - gsnu200843


"Otto Moehrbach" wrote:

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




Otto Moehrbach[_2_]

Need to return to display
 
Rick & GS
Thanks for the help. Both methods work just great. Otto
"Otto Moehrbach" wrote in message
...
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





All times are GMT +1. The time now is 05:32 PM.

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