MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Excel Active Cell Indicator Format

Posted by Jane Althar on December 12, 2001 5:18 PM

Is it possible to change the color and/or size of the box which indicates the active cell?

Posted by Joe Was on December 12, 2001 5:35 PM

This code must be put in the sheet tab code page!
Do not change the name or it will fail.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Target, Selection) Is Nothing Then
If Target.Interior.ColorIndex = 34 Then
Target.Interior.ColorIndex = 0
Target.Interior.ColorIndex = 34
End If
End If
End Sub

This code will change the selection cyan it will stay cyan until it is selected again, it works like a highlighter. Clik once its colored, click again and its normal. It will also do ranges.

You can modify it to change color only in a pre-selected portion of your sheet, to do this change:

"If Not Intersect(Target, Selection) Is Nothing" to "If Not Intersect(Target, Range("A1:E10")) Is Nothing"

With this change the selection color change will only take place from cells A1 to E10. JSW