Can I get some help with the syntax of the vbYesNo MsgBox? I have this right now,
For i = 1 To 10
If Not (cells(i,1).value = "0" OR cells(i,1).value = "30") Then
Range(cells(i, 1), cells(i, 1).End(xlToRight)).Select
ans = MsgBox("Do you want to delete this row?", vbYesNo)
If ans = vbYes Then
'I do something
Else
'I want to exit this the If and continue on the For loop
Exit If
End If
End If
Next i
I tried End If and Exit If but doesn't work. Can I get some help?
ans
......... - Mathieu GuindonEnd IF
? You don't always have to putElse
withIf
statements. Note though, your loop will not prompt the user 10 times for an answer. They're asked once (before the loop) and based on that, the loop will either do things, or skip completely. - BruceWayneans
isn'tvbYes
? - Mathieu Guindon