View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default can you make this faster?

Hi John,

John wrote:
here is the code... is there a quicker way to do this?

Private Sub Worksheet_Calculate()
Dim Target As Range
For Each Target In Range("p4:p34")
If Target.Value = True Then
Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = 15
End If
If Target.Value = False Then
Cells(Target.Row, "G").Resize(1, 24).Interior.ColorIndex = xlNone
End If
Next
End Sub


This is the perfect situation for conditional formatting:

http://www.contextures.com/xlCondFormat03.html

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]