The Labels  in VBA for Excel

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

 

VBA Chapter 24B of 24: The Labels  in VBA for Excel

In the toolbox the label has this icon   VBA for Excel labels icon. The label is a passive control meaning that the user never really acts on it. It is there to inform the user and to label other controls like text boxes, combo boxes or list boxes.

Properties

The other interesting properties of the label are:

- TabStop: To make the control invisible for the "Tab" and "Enter" keys (see Tab Order) set this property to "False" .
- WordWrap: If you want to write more than one line of text in a label set this property to "True" .

Code

There is not much coding developed for  the labels although there are 8 events related to the label. For example there is an event named "MouseMove" . If you develop code within this event it is executed when the mouse moves over the label. If the code is the following:
MsgBox "Don't forget to..."
a message box will appear when the user moves the mouse over the label.

You can stack many labels one over the other and make their "Visible" property to "False" .   You can then make any of the label visible from an event related to another control. For example if a user chooses a certain value in a combo box a certain label appears.

 

Next Chapter: Programming Text Boxes in VBA for Excel

VBA Table of Contents
or use the quick links below

 

Discover Even More in 50 Excel spreadsheets

 

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

The Labels  in VBA for Excel