Sub messageBoxTest() Dim intButtonPressed As Integer intButtonPressed = msgBox("Welcome to VBA", vbYesNo, "Message Box Test") If intButtonPressed = vbYes Then msgBox "Yes was selected" Else msgBox "No was selected" End If End Sub