Reputation: 1181
This code displays a MsgBox and asks a question. The result is returned in a VbMsgBoxResult and is converted to Boolean.
Dim gobox as VbMsgBoxResult
dim go as boolean
gobox = MsgBox("Question?", vbYesNo, "Descriptive Titel")
If gobox = vbYes Then
go = True
Else
go = False
End If
Is there an easier way to convert VbMsgBoxResult to Boolean?
Upvotes: 1
Views: 1474
Reputation: 12167
Maybe just
go = (MsgBox("Question?", vbYesNo, "Descriptive Titel") = vbYes)
Upvotes: 2