Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null | Excel Discussion (Misc queries) | |||
LOOKUP and return the column heading for IF/THEN return for False | Excel Discussion (Misc queries) | |||
check if reference exists, then return its value or return 0 | Excel Worksheet Functions | |||
VBA Syntax for VLOOKUP to return array of return values | Excel Programming |