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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi WoodyHays

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

Regards
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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