Modify a label's font size

Magic_Doctor

Board Regular
Joined
Mar 18, 2009
Messages
56
Hello,

I have a label in which there is a very short text.

To format the text I wrote the following procedure:

Private Sub LabelIntervallesDC1_Click()

With [LabelIntervallesDC1] 'Label's name
.Caption = "Intervalles" & vbCrLf & ">"
.ForeColor = &HFFFFFF 'white
.BackColor = &H4D74 'brown
End With

End Sub

So far no problem.

Now I would like ">" should be more emphasized, therefore I try to increase the font size, but only for this character (with other characters as size 7). I try the following bidouillage I place just before End Sub:

[LabelIntervallesDC1].Select
With ActiveSheet.Shapes.Characters(Start:=12, Length:=1).Font
.Size = 9
End With

Failed miserably .....

If any one of you could explain why... thank you very much

And excuse my bad english...​
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You can't do that with a label unfortunately. (your code wouldn't have worked anyway as you didn't specify which Shape)
 
Upvote 0

Forum statistics

Threads
1,203,269
Messages
6,054,482
Members
444,727
Latest member
Mayank Sharma

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