Editing WordArt FontSize

larnels

New Member
Joined
Jun 23, 2010
Messages
25
Editing WordArt using vba<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I am having a problem with editing a shape (WordArt). You can step through this “With, End-With” without any errors and every line works except .FontSize (in red, the size never changes). I can work around this by changing the height and width of the WordArt, but this is mostly trial and error to finally get the desired font size.<o:p></o:p>
Code:
<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]Sub ChngTxt1()<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]‘[/FONT][/COLOR][COLOR=black][FONT=Arial]With Sheets(1).Shapes(1).TextEffect<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial].Text = "Good Morning Everyone.”<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial].FontName = "Ariel"<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial].FontBold = True<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial].FontItalic = False<o:p></o:p>[/FONT][/COLOR]
[COLOR=red][FONT=Arial].FontSize = 16<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]End With<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]End Sub[/FONT][/COLOR]
[COLOR=black][FONT=Arial][\code]<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]Once again any help would be appreciated<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]larnels<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Arial]<o:p></o:p>[/FONT][/COLOR]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
This works for me - note your typo

Rich (BB code):
Sub ChngTxt1()
With Sheets(1).Shapes(1).TextEffect
    .Text = "Good Morning Everyone.”"
    .FontName = "Arial"
    .FontBold = True
    .FontItalic = False
    .FontSize = 16
End With
End Sub
 

larnels

New Member
Joined
Jun 23, 2010
Messages
25
Wow VoG, that was a really fast response, didn’t even have time to turn the pc off!. Unfortunately the typo was only in the post, not in the procedure. And it just won’t change the FontSize for me. I have tried exiting Excel and rebooting (basically clutching at straws). No help there. But it does works for you. Most weird. I’m completely stumped.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I actually had a couple of typos in the post (showed I had an apostrophe before the “With” which I didn’t have in the macro) and I didn’t properly use the bbcode (I think I might have been fighting this FontSize thing too long) so I’ll post the code again. Sorry about that.<o:p></o:p>
Thanks a bunch for the quick response though!<o:p></o:p>
larnels<o:p></o:p>
<o:p></o:p>
Reposted code:<o:p></o:p>
Rich (BB code):
Sub ChngTxt1()<o:p></o:p>
With Sheets(1).Shapes(1).TextEffect<o:p></o:p>
   .Text = "Good Morning Everyone.”<o:p></o:p>
   .FontName = "Arial"<o:p></o:p>
   .FontBold = True<o:p></o:p>
   .FontItalic = False<o:p></o:p>
   .FontSize = 16<o:p></o:p>
End With<o:p></o:p>
End Sub<o:p></o:p>
<o:p></o:p>
 
Last edited:

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Which version of Excel are you using? I checked using XL 2010.
 

larnels

New Member
Joined
Jun 23, 2010
Messages
25

ADVERTISEMENT

VoG, sorry again for not listing those important parameters of my system. I had them jotted down but didn’t include them in the post. I don’t think I am running on all cylinders today.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Windowsxp-sp2<o:p></o:p>
Excel 2000<o:p></o:p>
VBE 6.5<o:p></o:p>
Thanks again, larnels<o:p></o:p>
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
I'lll have to check in Excel 2000. Cannot do before tomorrow.
 

larnels

New Member
Joined
Jun 23, 2010
Messages
25

ADVERTISEMENT

VoG, you are really going to a lot of trouble trying to help me out. Anything you can do, no matter when will be greatly appreciated.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
larnels<o:p></o:p>
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
I've just tested in Excel 2000 and it works fine - no errors and achieves the desired result.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,274
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Works fine for me in 2007
 

larnels

New Member
Joined
Jun 23, 2010
Messages
25
Thanks VoG and Michael M for basically “proving” what I have been thinking about my FontSize problem. It is weird, but evidently there is something a little fouled up with my Excel installation. I am going to do a clean reinstall of Excel and see if that fixes the problem. It isn’t really that important, as I said I can work around it, but now it has turned into a mystery that will drive me crazy if I can’t figure it out.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Thanks again,<o:p></o:p>
larnels<o:p></o:p>
 
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,163,683
Messages
5,833,096
Members
430,193
Latest member
Samtk

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