View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default colour a row by code

Try the below..Right click the Sheet tabViewCode and paste the below code to
the code module...


Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("D:D")) Is Nothing Then
Range("A" & Target.Row & ":M" & Target.Row).Interior.ColorIndex = _
IIf(Target.Interior.ColorIndex = 15, 5, 15)
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Jock" wrote:

If I right click any cell in column "D", how can I get the cells A:M on the
same row to be coloured grey. If right clicked again, A:M to be restored to
original shade (blue)?

Thanks,
--
Traa Dy Liooar

Jock