Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
check if reference exists, then return its value or return 0 doudou Excel Worksheet Functions 1 June 4th 05 09:17 PM
VBA Syntax for VLOOKUP to return array of return values Alan Beban[_3_] Excel Programming 7 August 5th 03 11:41 AM


All times are GMT +1. The time now is 01:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"