I have a Yes/No MsgBox
in my VBA script that returns a question for the user to answer. Whenever the "Yes" or "No" buttons are pressed, besides the script running its respective code, another MsgBox
with the numbers "6" or "7" pops up. How do I disable this second MsgBox
?
Here's my code:
Dim question As Integer
question = MsgBox("Unfortunately, the Database has no sources regarding " & Category & " in " & country & ". Would you like to broaden your search and see all sources regarding " & country & "?", vbYesNo + vbQuestion, "Empty Sheet")
MsgBox question
If question = vbYes Then
Sheets("Results").Range("D6").ClearContents
Sheets("Results").Range("D7").ClearContents
Category = Sheets("Results").Range("D6").Value
Else
Sheets("Results").Range("D5").ClearContents
Sheets("Results").Range("D6").ClearContents
Sheets("Results").Range("D7").ClearContents
Exit Sub
End If
MsgBox
twice, don't you? – GSergMsgBox question
– Limakquestion = "Unfortunately, the Database has no sources regarding " & Category & " in " & country & ". Would you like to broaden your search and see all sources regarding " & country & "?."
would suffice – Rosetta