Sub ForEachLoop1()
For Each cl In Range("A1").CurrentRegion
cl.Select
If cl = 10 Then
cl.Interior.Color = vbRed
End If
Next cl
End Sub
Sub ForeachExample2()
Application.DisplayAlerts = True
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "Delhi" Then
Else
ws.Delete
End If
Next ws
For Each cl In Range("A1").CurrentRegion
cl.Select
If cl = 10 Then
cl.Interior.Color = vbRed
End If
Next cl
End Sub
Sub ForeachExample2()
Application.DisplayAlerts = True
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "Delhi" Then
Else
ws.Delete
End If
Next ws