The following code could be placed in either the Selection_Change procedure of a worksheet, or the SheetSelectionChange procedure of a workbook.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone<br>
Selection.Interior.ColorIndex = 8
End Sub
This code works for sheets with no fills in the background, as everytime the selection changes it makes all the cell interior colours equal to no fill. Different background colours could be substituted in instead of xlColorIndexNone if necessary. The colour of the cursor can also be changed (8 is cyan). See VBA help for color indexes.
Comments