PC Review


Reply
Thread Tools Rate Thread

Cell Visibility Algorithm

 
 
=?Utf-8?B?TmVhbCBaaW1t?=
Guest
Posts: n/a
 
      18th Nov 2007
Hi All,
I'm having difficulty finding out about the more 'technical' screen
properties.

I'm building this function to show the user a selected cell on a Ws
if it's on the screen and not in a hidden column.
I don't really want to unhide the column or scroll the display.

Sometimes a plain msg box, and others with a response.

For one worksheet type I know what columns will typically be 'on
the screen.'

What is a way to 'calculate' if a cell appears on the screen if
it's known that it's NOT in a hidden column ??

The code section below is marked: ???? HOW TO

Thanks,
Neal Z.


Public Function CellMsgValueF(CellRng As Range, Msg As String, _
Title As String, _
Optional bSelectCell As Boolean = False, _
Optional Button As Long = vbInformation) As String

' If Ws name passes mask and cell is hidden, add to Msg.
' If cell is not hidden and is 'on the screen', select the cell + show Msg.

Dim OldSelect As Range
Dim WsNa As String
Dim SaveColor As Integer
Dim bCellIsSeen As Boolean, bASU As Boolean


bASU = SCRNonF
EventsOFF
WsNa = ActiveSheet.Name

If WsNa Like gRmRteMsk Then 'will have hidden cols

Title = "Route " & WsNa

If Columns(DataRng.Column).Hidden = True Then

Msg = Msg & Cr2 & "Info Type," & Tb & RmRtColNaAy(DataRng.Column) _
& Cr & " Value," & Tb & DataRng.Value

ElseIf DataRng.Column <= iColX Then

bCellIsSeen = True

Else ' ???? HOW TO TELL IF CELL IS VISIBLE ON SCREEN.
'IF NOT HIDDEN, I DON'T WANT TO SCROLL THE SCREEN.
'OTHER COLUMNS MAY/MAY NOT BE HIDDEN AFFECTING WHAT'S ON SCREEN.
End If

Else ' SAME QUESTION AS ABOVE for different Ws's.

End If


If bCellIsSeen and bSelectCell Then
Set OldSelect = Selection
With CellRng
SaveColor = .Interior.ColorIndex
.Interior.ColorIndex = LightYellow 'a public constant
.Select
End With
End If


If Button Mod 16 = 0 And Button < 49 Then
MsgBox Msg, Button, Title
Else
CellMsgValueF = MsgBox(Msg, Button, Title)
End If


If bCellIsSeen and bSelectCell Then
CellRng.Interior.ColorIndex = SaveColor
OldSelect.Select
End If

EventsON
Call SCRNback(bASU)

End Function


 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      18th Nov 2007

Neal,
ActiveWindow.VisibleRange returns a range object that represents the
cells visible in the window.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Neal Zimm" <(E-Mail Removed)>
wrote in message
Hi All,
I'm having difficulty finding out about the more 'technical' screen
properties.
I'm building this function to show the user a selected cell on a Ws
if it's on the screen and not in a hidden column.
I don't really want to unhide the column or scroll the display.
Sometimes a plain msg box, and others with a response.
For one worksheet type I know what columns will typically be 'on
the screen.'
What is a way to 'calculate' if a cell appears on the screen if
it's known that it's NOT in a hidden column ??
The code section below is marked: ???? HOW TO
Thanks,
Neal Z.

-snip-
 
Reply With Quote
 
=?Utf-8?B?TmVhbCBaaW1t?=
Guest
Posts: n/a
 
      20th Nov 2007
Egads,
Thanks Jim, never thought to look @ activewindow properties, live and
learn.
Neal

--
Neal Z


"Jim Cone" wrote:

>
> Neal,
> ActiveWindow.VisibleRange returns a range object that represents the
> cells visible in the window.
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
>
>
> "Neal Zimm" <(E-Mail Removed)>
> wrote in message
> Hi All,
> I'm having difficulty finding out about the more 'technical' screen
> properties.
> I'm building this function to show the user a selected cell on a Ws
> if it's on the screen and not in a hidden column.
> I don't really want to unhide the column or scroll the display.
> Sometimes a plain msg box, and others with a response.
> For one worksheet type I know what columns will typically be 'on
> the screen.'
> What is a way to 'calculate' if a cell appears on the screen if
> it's known that it's NOT in a hidden column ??
> The code section below is marked: ???? HOW TO
> Thanks,
> Neal Z.
>
> -snip-
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make active cell border prominent and keep entire active row selected for better visibility Radhika Microsoft Excel Programming 2 30th Dec 2008 08:51 AM
Visibility of contents in a merged cell =?Utf-8?B?VmFybmU=?= Microsoft Excel Programming 4 16th May 2007 01:26 PM
[OT] Looking for algorithm Chris Dunaway Microsoft C# .NET 7 12th Apr 2007 07:04 PM
Visibility of active cell. =?Utf-8?B?Z2phbnNzZW5tbg==?= Microsoft Excel Misc 1 4th Oct 2005 06:24 PM
algorithm? kathy Microsoft C# .NET 14 28th Aug 2003 07:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.