Excel VBA Programming For Dummies, 3rd Edition
xiv
Label control ......................................................................................272
ListBox control
...................................................................................272
MultiPage control...............................................................................274
OptionButton control
........................................................................ 274
RefEdit control
...................................................................................275
ScrollBar control
................................................................................276
SpinButton control
............................................................................277
TabStrip control
.................................................................................277
TextBox control
.................................................................................278
ToggleButton control
........................................................................279
Working with Dialog Box Controls
............................................................279
Moving and resizing controls
...........................................................279
Aligning and spacing controls
..........................................................280
Accommodating keyboard users
..................................................... 280
Testing a UserForm
...........................................................................282
Dialog Box Aesthetics
.................................................................................282
Chapter 18: UserForm Techniques and Tricks ...................283
Using Dialog Boxes ...................................................................................... 283
A UserForm Example
...................................................................................284
Creating the dialog box
..................................................................... 284
Writing code to display the dialog box
........................................... 286
Making the macro available
..............................................................286
Trying out your dialog box
............................................................... 287
Adding event-handler procedures
...................................................288
Validating the data
.............................................................................289
Now the dialog box works
................................................................290
More UserForm Examples
..........................................................................290
A ListBox example
.............................................................................290
Selecting a range
................................................................................ 295
Using multiple sets of OptionButtons
.............................................297
Using a SpinButton and a TextBox
..................................................297
Using a UserForm as a progress indicator
.....................................299
Creating a modeless tabbed dialog box
..........................................303
Displaying a chart in a UserForm.....................................................304
A Dialog Box Checklist
................................................................................ 305
Chapter 19: Accessing Your Macros through the User Interface . . .307
Ribbon Customization ................................................................................307
Customizing the Ribbon manually
...................................................307
Adding a macro to the Ribbon
.........................................................310
Customizing the Ribbon with XML
.................................................. 310
Customizing Shortcut Menus
..................................................................... 314
Commanding the CommandBars collection
...................................315
Listing all shortcut menus
................................................................315
Referring to CommandBars
..............................................................315
Referring to controls in a CommandBar
......................................... 316
Properties of CommandBar controls
..............................................317