Microsoft Office Tutorials and References
In Depth Information
Chapter 15: Advanced UserForm Techniques
To display a modeless UserForm, use a statement such as
The word vbModeless is a built-in constant that has a value of 0 . Therefore, the following
statement works identically:
Figure 15-1 shows a modeless dialog box that displays information about the active cell. When
the dialog box is displayed, the user is free to move the cell cursor, activate other sheets, and
perform other Excel actions. The information displayed in the dialog box changes when the
active cell changes.
Figure 15-1: This modeless dialog box remains visible while the user continues working.
This example, named modeless userform1.xlsm , is available on the companion
The key is determining when to update the information in the dialog box. To do so, the example
monitors two workbook events: SheetSelectionChange and SheetActivate . These
eventhandler procedures are located in the code module for the ThisWorkbook object.