Excel Macro: Displaying the Custom Lists Dialog Box

This Excel VBA macro displays the custom lists dialog box.

Macro Example

Sub ShowCustomListsDialogBox()

 Application.Dialogs(xlDialogOptionsListsAdd).Show

End Sub

Description

Application

  Application...

The Application property returns an Application object.

obj-Excel-Global-Application

Application.Dialogs

  Application.Dialogs...

The Application.Dialogs property returns the Dialogs collection objcect that represents all the built in dialog boxes in Microsoft Excel.

obj-Excel-Application-Dialogs

Dialogs[._Default](xlDialogOptionsListsAdd)

  Application.Dialogs(xlDialogOptionsListsAdd)...

The Dialogs._Default property returns a single dialog box.

obj-Excel-Dialogs-_Default

The _Default property is a default member of the Dialogs collection object. We can see a little blue marble beside its icon in the Object Browser.
So, we can omit the ._Default .
Well, the code:
Dialogs(xlDialogOptionsListsAdd) is equal
Dialogs._Default(xlDialogOptionsListsAdd)

And the Dialogs._Default(xlDialogOptionsListsAdd) returns the Custom Lists dialog box.

Dialog.Show

Finally, the Dialogs(xlDialogOptionsListsAdd).Show (Dialog.Show method) displays the custom lists dialog box.

Sub ShowCustomListsDialogBox()

 Application.Dialogs(xlDialogOptionsListsAdd).Show

End Sub

Properties

http://www.relief.jp/itnote/archives/013793.php

Apply to

  • Excel 2013
  • Excel 2010
  • Excel 2007