Reputation: 1
How would I write a VBA statement that basically says if "A1" says "Yes" ignore the rest of the my code and End otherwise go to the next line.
Thanks
I cant seem to get it to work, i cant get it to skip the rest of the code
Upvotes: 0
Views: 53
Reputation: 31
Easy... ;-)
Sub YesICan()
Dim rng As Range
Set rng = Selection
Dim cl As Range
For Each cl In rng.Cells
If LCase(cl) = "yes" Then
cl.Offset(, 1) = "Hi There!"
Else
cl.Offset(, 1) = ""
'do other stuff
End If
Next cl
End Sub
Upvotes: 0