Sometimes we want to automate some steps in Excel to save us time, however it’s cumbersome to code the exact macro for it – especially as a VBA beginner.
But you know what? There is an easy way around 🙂
You can try out the Macro Recorder to mimic each step inside Excel and reuse those steps next time around. How cool is that?!
Make sure your Excel ribbon has the Developer Tab enabled following this tutorial.
Turn on the Macro Recorder, do the steps, stop the Macro Recorder, run the Macro and bam! Excel will repeat the exact same steps you just did!
I explain how you can do this below:
STEP 1: Go to Developer > Record Macro
Go with the default name Macro1 and click OK.
STEP 2: Now it’s starting to record! Here’s what we want to do:
- Select a Cell (A8 in our example below)
- Click Bold
- Click Italic
- Select the highlight color to be yellow
Go to Developer > Stop Recording
STEP 3: Now let us try out the macro in action.
Select the rest of the cells that we want to apply the actions on.
Go to Developer > Macros
Make sure Macro1 is selected and click Run.
And it’s like magic! The same steps are now applied!
STEP 4: Let us have a look how that magic was done. Go to Developer > Visual Basic
Go to Modules > Module1. You can see the code that does the following: Setting Bold, Italic, and filling the color with Yellow:
Use Macro Recorder in Excel