Return to Snippet

Revision: 42377
at March 4, 2011 03:27 by aianrnoens

Initial Code
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static OldCell As Range
If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If
Target.Interior.ColorIndex = 6 'yellow
Set OldCell = Target
End Sub

Initial URL

Initial Description
Use this code to change the default highlight color for a cell in excel 2007.   Right click on the sheet name and click view code,  Paste this code into the module that comes up.

Initial Title
Change Highlight Color Excel 2007

Initial Tags
excel, color

Initial Language
Visual Basic