When exploring a workbook, I like to color-code cells so that I remember what I need to do with that information. Red cells indicate I need to take action on something, while green means all systems go.
Yellow means either neutral, or that I haven’t decided yet!
That’s my system, anyway. And maybe you have your own (please leave it in the comments!).
One thing we can all agree on, though, is that filling cells from from the home ribbon is annoying. It requires precise, time-consuming, pointing-and-clicking from the mouse.
Wouldn’t it be great to just make our own keyboard shortcuts to fill cells? For example, Ctrl + Shift + R, and our selection is filled red, and so forth.
Consider it done.
Simply click to Developer | Visual Basic and paste the below code into a module under your Personal.XLSB workbook.
To assign keyboard shortcuts to the macros you created, go to Developer | Macros and select the pertinent macro (Red, Yellow or Green). Select Options and type your keyboard shortcut.
For example, I assigned Ctrl + Shift + G to the Green macro. When I hit that keystroke, I get a green cell.
This one-line macro code saves me lots of time when I’m marking up my worksheets, and I hope you can use it too.
Intrigued?
This exercise takes advantage of Excel’s color system and VBA. This technical documentation from Microsoft has all the gory details of how colors in Excel work. It’s a deep topic – dark, ocean blue (see what I did there?).
And for VBA, I suggest my friend Jon Acampora’s VBA Pro Course.
Please note that I am an affiliate of Jon’s course and receive a portion of any sales generated with the above links.
Jaina m kothari
How do I again assign a macro to remove the color
George Mount
Hi Jaina, This article should do it.