Pop Up Input Box
Ever wish you could ask someone a bunch of questions and have them entered into the appropriate cells? With this macro, you can have an input box pop up asking the user to answer a question (i.e. what is your name, what is your address, etc.). By defining the user’s response with a unique name, you can have the macro populate the file for you.
Use the example below as a guide. It asks for the user’s name, address, city, state and zip code, and enters the responses in a cell. You can change the questions, change the cells that the answers populate, and add or delete questions. Just be consistent with naming the responses (i.e. “YourCity” should be “YourCity” wherever it shows up in the code below).
Copy all of the code below. Paste it into your workbook’s Visual Basic editor, either under a Microsoft Excel Object or Module.
Sub GetInput()
'
'MACROS BY EXCELZOOM.COM
'
Dim YourName
YourName = InputBox("Enter your name")
Range("A1") = YourName
Dim YourAddress
YourAddress = InputBox("Enter your address")
Range("A2") = YourAddress
Dim YourCity
YourCity = InputBox("Enter your city")
Range("A3") = YourCity
Dim YourState
YourState = InputBox("Enter your state")
Range("B3") = YourState
Dim YourZip
YourZip = InputBox("Enter your zip code")
Range("C3") = YourZip
End Sub