Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Save the return value from MsgBox to a variable

Sub Informant2()     Dim myPrompt As String     Dim town As String     Const myTitle = "Enter data"     myPrompt = "Place of birth:" & Chr(13) & "(e.g., Boston, Great Falls, etc.)"          town = InputBox(myPrompt, myTitle)     MsgBox "You were born in " & town & ".", , "Your response" End Sub