Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA updating text box label

Status
Not open for further replies.

PL01

Technical User
Jun 9, 2008
57
US
Anybody know the VBA to update a text box label?
 
Are those controls on a UserForm?
"text box label" - there is a text box and there is a label.
Text box has Text property, label has a Caption property.
[tt]
txtMyTextBox.Text = "I am a Text Box"
lblMyLabel.Caption = "I am a label"
[/tt]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
If the label is attached to the text box then you can also
myTextBox.controls(0).caption = "Some Text"
Not really any easier but sometimes useful in generic code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top