Types of Dialogs

There are many different ways to display dialog boxes using Visual Basic in Excel, so it is helpful to organize those techniques by starting with the type of dialog box you want to display. The three main sorts of dialog boxes are informational displays, data-entry forms, and other tasks. Table 20-1 organizes the ways to display dialogs based on those types.

Table 20-1. Types of dialogs and how to display them

Type of dialog


Use one of these


Informational display

Success message

MsgBox function

Chapter 3



Help or FollowHyperLink method

Chapter 6


Enter values in a list

ShowDataForm method

This chapter


Advanced data entry

User form

This chapter


Get a value or range

InputBox method

Chapters 3, 7


Get a file or folder name

FileDialog, GetOpenFilename, or GetSaveAsFilename method

Chapter 7


Show a built-in Excel dialog box

Dialogs method

Chapter 7


Set task options or custom properties

User form

This chapter



User form

This chapter

As you can see from Table 20-1, Excel handles the well-structured tasks for you, but as your needs become open-ended, you need to start creating your own user forms. The lesson from Table 20-1 is to not start with the Forms Designer—look around first to see if Excel already does the work for you!

Get Programming Excel with VBA and .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.