Excel VBA Alternate Row Colors

This post will demonstrate a simple VBA macro to shade background colors for alternate rows in a specified range.  This can come in handy when you need to reset the alternate colors for different files, or if you are looking to test out different combinations and want to cycle through them quickly.

Version of Excel: 2013

OS: Windows 10

Excel VBA Alternate Row Colors – Setup

Let’s start with the following table:

Excel VBA Alternate Row Colors

Next, add the following module in the VBA Editor:

Run the macro, and here is what your Excel table looks like:

Excel VBA Alternate Row Colors

You can set the color variables to any of the following, to get your desired look:

Excel VBA Alternate Row Colors

Excel VBA Alternate Row Colors

 

 

 

Additional Content

Check out more examples by visiting my Home Page

Here you will find topics covering Qlikview SQL Server Excel VBA

 

 

Leave a Comment