label caption

R

Rod Taylor

Can I add a variable to the caption of a label on a form

i.e. Label1.Caption = ("What Shift for" & CONTROLLERS_INITIALS)

where CONTROLLERS_INITIALS is a variable
 
B

Bob Kilmer

Rod,
I would have tried it by now, if I were me, and found it to work. The
Caption property takes a string. You can assign any valid string to the
Caption property - even a concatenated one.
 
T

Tom Ogilvy

CONTROLLERS_INITIALS = "ABC"
Label1.Caption = "What Shift for " & CONTROLLERS_INITIALS

Should work.

Depending on where the code is located, you might need to qualify Label1

Userform1.Label1.Caption =

or

Sheet1.Label1.Caption =

as examples.

Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top