Displaying Excels BuiltIn Dialog Boxes

Code that you write in VBA can execute many of Excel's Ribbon commands. And, if the command leads to a dialog box, your code can "make choices" in the dialog box (although the dialog box itself isn't displayed). For example, the following VBA statement is equivalent to choosing the Home Editing

Find & Select Go To command, specifying range A1:C3, and clicking OK. But the Go To dialog box never appears (which is what you want).

Application.Goto Reference:=Range("A1:C3")

In some cases, however, you may want to display one of Excel's built-in dialog boxes so that the end user can make the choices. You can do this by accessing the Dialogs collection of the Application object.

0 0

Post a comment