Thread: Nested Ifs
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Nested Ifs

If date1 Date Then
MsgBox "Cancel Action", vbOKOnly
ElseIf date1 <= Date Then
Response = MsgBox (" Are you sure?",vbYesNoCancel)
If Response = vbYes Then
MsgBox "Do Action",vbYesNoCancel
End If
End If

Indenting helps to see the flow.

--

HTH

RP

"Myriam" wrote in message
...
I need 3 consecutive message boxes to show if conditions are met
and User responds yes.
I can make 2 work but I can't get the 3rd IF to work.
e.g.,
This portion works fine:
--------------------------------
If date1 Date Then
MsgBox "Cancel Action", vbOKOnly
ElseIf date1 <= Date Then
MsgBox " Are you sure?",vbYesNoCancel
--------------------
'This last one is the one I need help with:

If Response = vbYes Then
MsgBox "Do Action",vbYesNoCancel
------------------------------
Thanks in advance, you are all great!