Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default IsCellVisible(range) or VisibleCellRange(wks) needed.

I need those functions...

I need a way to get the address range of the cells that are currently
showing on the screen for a given worksheet. OR a way to know if a cell or
range of cells are currently "on the screen". Screen resolution and the size
of each cell will have to be taken into account.

I have thought about using API calls to get the screen resolution and then
using .height and .width to get the X,Y,H,W values of every cell's
(rectangle) then from that, calculate which cells are currently showing on
the screen.

Is there a better way?

I am trying to come up with some routines that can be used keep pertinent
data showing on the screen no matter how the user has their screen sizing
set. (with in certain boundaries of course, I.E. at least 15 rows and 4
columns or some preset limit; perhaps an upper limit too) I could also see
using this to know when to scroll the screen to keep a block of cells near
the center of the screen.

--
Regards,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default IsCellVisible(range) or VisibleCellRange(wks) needed.

maybe you could use:

MsgBox ActiveWindow.VisibleRange.Address
or
MsgBox ActiveWindow.VisibleRange.Cells.SpecialCells(xlCel lTypeVisible).Address

But as a user, I wouldn't like what you're trying to do. If I've arranged
multiple windows so I could see stuff. I wouldn't want something to change my
layout.

John Keith wrote:

I need those functions...

I need a way to get the address range of the cells that are currently
showing on the screen for a given worksheet. OR a way to know if a cell or
range of cells are currently "on the screen". Screen resolution and the size
of each cell will have to be taken into account.

I have thought about using API calls to get the screen resolution and then
using .height and .width to get the X,Y,H,W values of every cell's
(rectangle) then from that, calculate which cells are currently showing on
the screen.

Is there a better way?

I am trying to come up with some routines that can be used keep pertinent
data showing on the screen no matter how the user has their screen sizing
set. (with in certain boundaries of course, I.E. at least 15 rows and 4
columns or some preset limit; perhaps an upper limit too) I could also see
using this to know when to scroll the screen to keep a block of cells near
the center of the screen.

--
Regards,
John


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default IsCellVisible(range) or VisibleCellRange(wks) needed.

Excellent! That's what I was looking for.

I always forget to check the ActiveWindow object for solutions (I'm stuck on
Worksheets)

And I agree about not changing the sizing of multiple open windows. What I
intended when saying "to scroll the screen to keep a block of cells near the
center of the screen." was to keep things centered within the "ActiveWindow"
--- we have to keep the user's happy!

--
Regards,
John


"Dave Peterson" wrote:

maybe you could use:

MsgBox ActiveWindow.VisibleRange.Address
or
MsgBox ActiveWindow.VisibleRange.Cells.SpecialCells(xlCel lTypeVisible).Address

But as a user, I wouldn't like what you're trying to do. If I've arranged
multiple windows so I could see stuff. I wouldn't want something to change my
layout.

John Keith wrote:

I need those functions...

I need a way to get the address range of the cells that are currently
showing on the screen for a given worksheet. OR a way to know if a cell or
range of cells are currently "on the screen". Screen resolution and the size
of each cell will have to be taken into account.

I have thought about using API calls to get the screen resolution and then
using .height and .width to get the X,Y,H,W values of every cell's
(rectangle) then from that, calculate which cells are currently showing on
the screen.

Is there a better way?

I am trying to come up with some routines that can be used keep pertinent
data showing on the screen no matter how the user has their screen sizing
set. (with in certain boundaries of course, I.E. at least 15 rows and 4
columns or some preset limit; perhaps an upper limit too) I could also see
using this to know when to scroll the screen to keep a block of cells near
the center of the screen.

--
Regards,
John


--

Dave Peterson

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
VBA Range definition: Code needed David B Excel Discussion (Misc queries) 8 September 25th 06 06:40 PM
Dynamic naming of range needed XXL User Excel Worksheet Functions 2 August 3rd 06 08:26 PM
ranking in a dynamic range help needed?? barkiny Excel Worksheet Functions 2 May 15th 06 05:21 PM
Totaling range help needed Tempy Excel Programming 2 September 30th 05 02:30 PM
Formula needed for date range klt Excel Programming 5 April 15th 05 11:43 PM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"