Core question/in a nutshell:
How can I assign the following VBA macro to a hotkey/key combo in Microsoft Word for MacOS? It's driving me around the bend.
System info:
- Hardware: M1 Macbook Pro
- OS: MacOS Sonoma 14.2.1
- Microsoft Word: Version 16.81 for Mac
Problem at hand:
I'm trying to set up VBA macros to do the following:
a) turn selected text green b) turn selected text red and strike it through
While written VBA code appears to work when manually selecting 'run', I'm struggling to get it to set to hotkeys. I want to be able to press a key combo (i.e. ctrl + G, or ctrl + R) and have said macros run. Despite my best efforts, I appear unable to do this and don't know why.
Attempts so far:
I've tried recording a macro and assigning a key combo from within the pop-up menu that opens when pressing 'record macro'. I've then taken the steps and saved. Sadly, changing font colour doesn't appear to be recorded when using 'record macro', so I've had to alter the VBA code within the macro to the following:
Sub ChangeToGreen()
'
' ChangeToGreen Macro
'
With Selection.Font
.Color = RGB(0, 255, 0) ' This sets the color to green
End With
End Sub
I've tried finding menus within Microsoft Word on MacOS to manually assign this to a hotkey/key combo after saving, but haven't been able to find one. Please help!