PDA

View Full Version : Solved: What Screen Am I Looking At Now?



Cyberdude
08-15-2006, 12:45 PM
I asked this question a good while back and I used the response I was given at that time. Now I can't remember either the response or where I used it. One more time ...
I'm looking at a portion of a worksheet on my screen. What is the VBA statement that will tell me where I am looking?

Bob Phillips
08-15-2006, 12:48 PM
Is this it http://www.vbaexpress.com/forum/showthread.php?t=2990 (http://www.vbaexpress.com/forum/showthread.php?t=2990&highlight=screen+vba)

Cyberdude
08-15-2006, 01:03 PM
No, xld, that's not the one. It seems to me that the VBA statement I'm looking for returns some sheet coordinates, like the address of the upper left corner that's being displayed on the screen. I've done various searches, but I'm not using the correct keyword, whatever it is.

mdmackillop
08-15-2006, 01:29 PM
Any use?
With ActiveWindow
MsgBox Cells(.ScrollRow, .ScrollColumn).address
End With

Cyberdude
08-15-2006, 01:44 PM
Malcolm, I don't think that's what I had in mind, but it DOES tell me what I want to know. Thanks for the response.
I have a feeling that it was Killian who answered my last post ... Killian, are you listening?

mdmackillop
08-15-2006, 01:49 PM
For the range

MsgBox ActiveWindow.VisibleRange.address

Cyberdude
08-15-2006, 08:30 PM
Malcolm, that's the one. You're probably the one who suggested it before, you dawg! This is a better solution since it provides a lower righthand corner address as well as the upper lefthand corner. Both techniques are subject to the limitation of a frozen screen and some others, but I'm aware of that. I really appreciate your assist. :friends: