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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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.:)
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top