Text Box font

WoodyHays

Board Regular
Joined
May 14, 2002
Messages
185
I am trying to change the font of a text box that is grouped with another object, a line.

Do I have to ungroup them first, then change the font? I can't get that to work either.

Code:
Sub ChangeSpecificTextBox()

    ActiveSheet.Shape("rectangle 31").Select
                
        With Selected.TextFrame
            .Characters.Font.Name = "arial"
            .Characters.Font.FontStyle = "regular"
        End With
End Sub

These shapes and shapeRanges really confuse me.


Thanks,
Woody Hays
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
Hi WoodyHays

Just curious - could you not change the text by right click and then format?

Regards
 

WoodyHays

Board Regular
Joined
May 14, 2002
Messages
185
Thanks for your response,

Yes, I caould change it manually, but this is for an application that will be used by many users and there are many such rectangles. I have to have an automated way to manage it.

Thanks,
Woody Hays
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
Hi Woody,
Try this slight change and see if it works for you.

With Selection.Characters.Font
.Name = "Arial"
.FontStyle = "Regular"
End With

This help?
Dan
 

WoodyHays

Board Regular
Joined
May 14, 2002
Messages
185
HalfAce,
Yes it worked after another slight modification.

Perfect...Thanks.

I am leaving early in the morning to go to Charlotte NC to start training users and this was the last piece I needed.

It works fine with grouped objects, I don't have to mess with ungrouping them.

Woody Hays
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,876
Messages
5,766,875
Members
425,383
Latest member
IllDo

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
Top