Jammydan
Board Regular
- Joined
- Feb 15, 2010
- Messages
- 141
Hi, I have the following code which works fine...
However as soon as I add
as below it seems to loop for about 2 minutes.
Can anybody help please?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Dim SelectDG As Range
Dim UserDG As Range
Set SelectDG = Range("F10:F100")
Set UserDG = Range("O2")
Application.ScreenUpdating = False
'**** PLEASE SELECT RANGES ****
For Each Cell In SelectDG
If Cell.Value = "Please Select" Then
Cell.Interior.ColorIndex = 36
ElseIf Cell.Value = "Yes" Then
With Cell
.Interior.ColorIndex = 43
End With
ElseIf Cell.Value = "No" Then
Cell.Interior.ColorIndex = 44
ElseIf Cell.Value = "N/A" Then
Cell.Interior.ColorIndex = 2
End If
Next
End Sub
However as soon as I add
Code:
.Offset(0, 1) = UserDG
Code:
ElseIf Cell.Value = "Yes" Then
With Cell
.Interior.ColorIndex = 43
.Offset(0, 1) = UserDG
End With
Can anybody help please?