Nesting MSGBOX

Jake975

Board Regular
Joined
Feb 9, 2020
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
Im trying to get nesting MSGboxes to work? Not sure what im doing wrong I have tried several ways. Can you please help
This is what i currently have and i know it doesn't work as is
VBA Code:
Sub MsgBoxInfo()

  Dim answer As Integer
  Dim answer2 As Integer
  Dim answer3 As Integer
  
  answer = MsgBox("The process will now get all related files." & vbNewLine & "If the process is stopped here nothing will be chaanged.", vbYesNoCancel + vbInformation)
  If answer = vbYes Then
  Call Get_Files_Information
  If answer = vbNo Then
  Else
  answer2 = MsgBox("Do Temp?", vbYesNo)
  If answer2 = vbYes Then
  Call MsgBoxInfo1
  If answer2 = vbNo Then
  Else
  answer3 = MsgBox("Merge file?", vbYesNo)
  If answer3 = vbYes Then
  Call MsgBox_3
  If answer3 = vbNo Then

  Else
  End If
  End If
  End If
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi
try

VBA Code:
Sub MsgBoxInfo()
    
    Dim answer As VbMsgBoxResult
    
    answer = MsgBox("The process will now get all related files." & vbNewLine & _
    "If the process is stopped here nothing will be changed.", vbYesNo + vbInformation)
    
    If answer = vbYes Then
        Call Get_Files_Information
    Else
        answer = MsgBox("Do Temp?", vbYesNo + vbQuestion, "Do You Temp")
        If answer = vbYes Then
            Call MsgBoxInfo1
        Else
            answer = MsgBox("Merge file?", vbYesNo + vbQuestion, "Merge File")
            If answer = vbYes Then Call MsgBox_3
        End If
    End If
End Sub

Dave
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top