View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Colour by clicking cell

How about double-click?

This is a demo for cell B2:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("B2")) Is Nothing Then
Exit Sub
End If
If Target.Interior.ColorIndex = 6 Then
Target.Interior.ColorIndex = xlNone
Else
Target.Interior.ColorIndex = 6
End If
Cancel = True
End Sub

This goes in worksheet code, not a standard module.
--
Gary's Student
gsnu200702


"ronoee" wrote:

I am searching for a way to change background colour by click in a cell and
back to normal colour by clicking it again.
Is this possible? And if how is it don?

Thank you in advance.