Is cell on screen? (1 Viewer)

PearlGI

Registered User.
Local time
Today, 16:44
Joined
Aug 30, 2001
Messages
125
Does anyone know if it's possible to determine whether a cell is currently displayed on the visiblle part of users screen?
 

ghudson

Registered User.
Local time
Today, 11:44
Joined
Jun 8, 2002
Messages
6,194
Interesting question. I had to find a solution for all the different resolutions my users have their computers set to. I used the code I found @ http://www.ozgrid.com/forum/showthread.php?t=21931 Instead of testing for the width, I had to test for the height since I had buttons at the bottom I needed the user to see.
 

PearlGI

Registered User.
Local time
Today, 16:44
Joined
Aug 30, 2001
Messages
125
Hi, thanks for the reply. Not quite the solution I was hoping for, but maybe I can change my approach.

Maybe if I explain further what I was trying to do. In simple terms, all cells in the workbook have been resized to small squares and the VBA is controlling a 'ball' (aka a small cell) that bounces around the screen. What I needed to be able to test for was when the 'ball' goes off the screen. Yes, I know I could restrict the playing area to a predetermined size, but I wanted to give the user complete flexibility over the size of their playing area.

I suspect that Excel does 'know' this, as if you have 'transition keys' enabled via Options and then you hit the tab key, it moves one visible screen width to the right.
 

ghudson

Registered User.
Local time
Today, 11:44
Joined
Jun 8, 2002
Messages
6,194
Even more interesting, you are making something fun! I would love to see it [play it] when you are done.
 

chergh

blah
Local time
Today, 16:44
Joined
Jun 15, 2004
Messages
1,414
Best you can do is to know the width & height of the window and know the width and heights of your colums and rows and calculate it from that. Activewindow.height and activecolumn.width will give the resolution.
 

Users who are viewing this thread

Top Bottom