Prompting for Information

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

There are several different ways you can prompt for information from a user.

  • Use the Visual Basic InputBox function to display a dialog box with a message and an edit box. When the user clicks OK, the function returns the text that the user entered.

  • Use the Visual Basic MsgBox function to display a simple message. You can display several different command buttons and icons. This function returns a number that indicates which button was clicked.

  • Use a built-in Microsoft Word dialog box to get user input for a specific Word feature.

  • Use a custom form to get user input. For information about adding controls to a form, see Add a control to a form.