VBA: Changing Font/Size of text in same line in Caption Box

screech

Active Member
Joined
May 27, 2004
Messages
296
Hello everyone, hope the end of the year is going well for you all.

I have the following piece of code for a caption for a box in a form:

.Label10.Caption = "Current Time : " & Format(ActiveCell.End(xlToLeft).Value, "mm/dd/yyyy h:mm") & ")"

It displays something like: "Current Time : 12/27/05 13:00" in the caption.

What I would like for it to do is to have "Current Time" to be bold and font size 9 while the time to be not bold and font size 8. I'm not sure if I can do this to a single caption in VBA. (also, if "current time" could be left justified and the time to be right justified.

It is okay if it cannot be done as I could make two separate captions next to each other to format separately, but I thought I would ask if someone knew of a trick to do this with one caption.

Thanks for all of your help.

Screech
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,047
Office Version
  1. 365
Platform
  1. Windows
I'm sorry but you answered your own quesrion - it can't be done.:)

You also suggested the solution that I think most folk would have - use more than 1 control.:)
 

screech

Active Member
Joined
May 27, 2004
Messages
296
Thanks. I assumed that making a new box would be the easiest (or only) way.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,056
Messages
5,569,953
Members
412,299
Latest member
agentless
Top