Have you thought of putting your secret stuff in the comment? Then when you
move your mouse over that cell, the comment will appear (assuming you're showing
comments).
But there is no mouseover event for a cell.
But you could do something like putting two images from from the control toolbox
toolbar over the cells.
Make one kind of smaller and one a little bigger. Right click on each and
select properties. Make the backstyle transparent and make the borderstyle none
(so that they don't look like they're there.)
Position them over your range (A1:I1)
Make it so the little one is contained by the larger one and the larger one has
a little "border" showing. Then right click on the larger one and choose Order
and then Send to back. (Now the little one is on top of the larger one.)
+-------------------+
| |
| +------------+ |
| | | |
| +------------+ |
| |
+-------------------+
Call the little one image1 and the big one image2.
Now you can can check for movement of the mouse over those images.
Option Explicit
Private Sub Image1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, _
ByVal Y As Single)
Range("a1:i1").Font.ColorIndex = 1
End Sub
Private Sub Image2_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, _
ByVal Y As Single)
Range("a1:i1").Font.ColorIndex = 15
End Sub
This goes under the worksheet module.
When you move the mouse over the small one, the font gets changed. When you
move off the cell, you'll (hopefully) move across the larger image and that'll
hide characters.
Hotbird wrote:
Mny thanks to both of you: Dave and Chip, for pointing out my foolish
mistake. I now am using the following code, and have Cells A1 to I1 hidden
until they are selected. Just a last point - is there an alternative way to
change the FONT.COLORINDEX by moving the mouse position, rather than
selecting the cells? This is because the selected cell has already been
carefully chosen for the next data entry in my spreadsheet?
----- Original Message -----
From: "Dave Peterson"
Newsgroups: microsoft.public.excel.programming
Sent: Sunday, August 10, 2003 8:19 PM
Subject: Show/Hide a Secret Cell
Chip didn't have:
Target.Font.Color.Index
he had
Target.Font.ColorIndex
(no dot in colorindex--for both parts)
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
I am wondering if it would be possible to implement a feature,
whereby a cell which contains information hidden as grey text on a
grey
background, could automatically change to black on grey in response to
mouse
movement over the cell in question. There do not seem to be standard
spreadsheet events to trigger the 2 necessary macros.
www.cpearson.com
--
Dave Peterson