#1
|
|||
|
|||
Macro to change font size
Hi, pretty new to macros and was just trying to make a simple one to change the font size of highlighted text. I hit record, changed the font size and then stopped it, and that macro, when activated, did nothing.
If it helps, here's the code for that macro: Sub Size10() ' ' Size10 Macro ' ' mySel = Selection.Font.Size mySel = 10 End Sub Any help would be appreciated, thanks! |
#2
|
||||
|
||||
You did something wrong when you recorded the macro. If done correctly this is what you were supposted to find:
Code:
Option Explicit Sub Size10() ' ' Size10 Macro ' ' Selection.Font.Size = 10 End Sub |
#3
|
|||
|
|||
You're correct, the code I posted was from one macro that I fooled around with (with 0 knowledge on the topic, as is apparent, lol). But the macros naturally recorded like you wrote it.
For some reason, all of those size macros are working today. Don't know what changed... |
#4
|
||||
|
||||
That's okay, as long as it works .
|
#5
|
|||
|
|||
I figured out the issue...this makes no sense. The macro works on english (regular left to right font), but when I use hebrew (right to left font) it doesn't work. Any ideas?
|
#6
|
|||
|
|||
Ok managed to solve this myself by googling it. In case anyone else gets stuck with this I learned that apparently VB has different character attributes for right to left languages, and the term bi needs to be added.
So the following change made it work: Code:
Sub Size14() ' ' Size14 Macro ' ' Selection.Font.Size = 14 Selection.Font.SizeBi = 14 End Sub |
#7
|
||||
|
||||
Thanks for sharing, always helpful.
|
#8
|
|||
|
|||
|
#9
|
|||
|
|||
Thanks, that's a good point. Honestly, I'm used to styles for headings and the likes but in the text itself I often change formatting for clarity (these are study notes), never really thought to make those into styles, interesting.
|
Tags |
macros |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to change font size of Footnote Reference in Footnote Text | TheBigBoss | Word VBA | 5 | 06-10-2022 06:14 AM |
VBA - Word how to globally change the font and font size in footnotes | thomasoj | Word VBA | 3 | 01-15-2020 06:26 AM |
VBA - change font and font size for Word footnote | thomasoj | Word VBA | 1 | 01-15-2020 02:37 AM |
create macro to change font size to 12.5pt | Chuck Barnett | Word | 5 | 02-28-2019 07:30 AM |
Looping Macro to Change Font, Font Size, and Give Heading 1 | WH7262 | Word VBA | 1 | 08-26-2014 03:46 PM |