View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Code looping until machine freezes!!?

Oops, left out the line to remove the formatting...
Jim Cone
'-----------
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Err_Cleanup
Application.EnableEvents = False
Dim Mycell As Excel.Range
Dim rng As Excel.Range
Set rng = Range("V2:V40")
If Not Application.Intersect(Target(1), rng) Is Nothing Then
For Each Mycell In rng
If Len(Mycell) Then
With Mycell.Interior
.ColorIndex = 44
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
Mycell.ClearFormats
End If
Next
End If
Err_Cleanup:
Set rng = Nothing
Application.EnableEvents = True
End Sub