Liglin,
Put the following code in the ThisWorkbook code module.
Private Sub Workbook_SheetSelectionChange( _
ByVal Sh As Object, ByVal Target As Range)
Static OldCI As Integer
Static OldRng As Range
If Not OldRng Is Nothing Then
OldRng.Interior.ColorIndex = OldCI
End If
OldCI = Target.Interior.ColorIndex
Set OldRng = Target
Target.Interior.ColorIndex = 3 'red
End Sub
You might also be interested in my RowLiner addin at
www.cpearson.com/excel/rowliner.htm .
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"liglin" wrote in message
m...
Hello,
I would like to write a macro that changes the color of a cell
to red
when it is clicked - could anyone help me with the click or
onmousedown event?
Thanks,
Liglin