View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default [VBA] Conditional Formatting

copy and paste this code into the worksheet code module. To open the module
window, right click the sheet tab and click View Code in the pop up menu.


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Range("A" & Target.Row & ":C" & Target.Row) _
.Interior.ColorIndex = 3
End If
End Sub



"Eddie_SP" wrote in message
...
Hi Community !

I need help.

I do not want to use "Conditional Formatting" in Excel. I need it by VBA.

If I put any value in a cell of column "D", columns A, B and C must be
changed to red colour.
I will need it in many cases, but as I've never worked with Cond. Form. in
VBA, it will help me in many ways in the future.

I thank you in advance ! =)