Link to home
Start Free TrialLog in
Avatar of victoriaharry
victoriaharry

asked on

VBA - Change font size during string

Hi Guys,

I have a chart title which I neet to change the font size for the 2nd line in the title so the first line appears in a large font and the 2nd line which will be a date appears in a smaller font. I have the code below which puts the correct text on both lines but I'm unsure how to change the font size for the 2nd line. Any ideas would be very appreaciated

ActiveChart.ChartTitle.Text = "Quality Gates - September" & Chr(10) & "From: " & Format(now(),"dd/mm/yyy")

Thanks

Gavin
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

You can't have more than one font size, color etc in a textbox. If Excel has a richtextbox you can use that but you should probably consider using two textboxes and splitting the text between the two.
Avatar of victoriaharry
victoriaharry

ASKER

Thanks for the reply. I'm al little confused though. If I create a chart manually with two lines of text in the title I can highlight the 2nd line of text and change the font size to whatever I want so that the size differs from the first line. I was hoping there was a way to replicate this action using VBA
Try creating and then editing a macro while you are achieving the effect that you want.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial