Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$C$3" Then Target.Font.ColorIndex = 1 Else Range("$C$3").Font.ColorIndex = 15 End If End Sub Put this code in the sheet module for the appropriate sheet. Change $C$3 to the cell in question and change the 15 to the correct colorindex value. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Hotbird" wrote in message ... 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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for your suggestion Chip
I am using a very simple test spreadsheet - one page only called "Sheet1", with text "11" in cell A1 with both font and background colour set grey. There is no Module, but Sheet1 has the following code: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "This Code is active 1" Target.Font.Color.Index = 1 ' black text Else MsgBox "This Code is active 2" Range("$A$1").Font.Color.Index = 15 'grey text End If End Sub I click on cell A1, but unfortunately, get a run-time error '424' saying "Object Required" and the Debug window highlights in yellow the line: Target.Font.Color.Index=1. Have I missed something obvious? Thank you again for taking the time to help. "Chip Pearson" wrote in message ... Try something like the following: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$C$3" Then Target.Font.ColorIndex = 1 Else Range("$C$3").Font.ColorIndex = 15 End If End Sub Put this code in the sheet module for the appropriate sheet. Change $C$3 to the cell in question and change the 15 to the correct colorindex value. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Hotbird" wrote in message ... 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chip didn't have:
Target.Font.Color.Index he had Target.Font.ColorIndex (no dot in colorindex--for both parts) Hotbird wrote: Many thanks for your suggestion Chip I am using a very simple test spreadsheet - one page only called "Sheet1", with text "11" in cell A1 with both font and background colour set grey. There is no Module, but Sheet1 has the following code: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "This Code is active 1" Target.Font.Color.Index = 1 ' black text Else MsgBox "This Code is active 2" Range("$A$1").Font.Color.Index = 15 'grey text End If End Sub I click on cell A1, but unfortunately, get a run-time error '424' saying "Object Required" and the Debug window highlights in yellow the line: Target.Font.Color.Index=1. Have I missed something obvious? Thank you again for taking the time to help. "Chip Pearson" wrote in message ... Try something like the following: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$C$3" Then Target.Font.ColorIndex = 1 Else Range("$C$3").Font.ColorIndex = 15 End If End Sub Put this code in the sheet module for the appropriate sheet. Change $C$3 to the cell in question and change the 15 to the correct colorindex value. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Hotbird" wrote in message ... 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. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I show/hide the cell comment blocks ? | New Users to Excel | |||
Show or Hide control characters in a cell (using Excel 2007)... | Excel Discussion (Misc queries) | |||
show or Hide cell comment when mouse hovers in Excel? | Excel Worksheet Functions | |||
how do I hide the #N/A to not show in the cell | Excel Worksheet Functions | |||
How do you show/hide individual cell gridlines in Excel 2007? | Excel Discussion (Misc queries) |