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]
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

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
19,148
Office Version
2013
Platform
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>
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,916
Messages
5,514,139
Members
408,985
Latest member
bchaabi

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top