Excel VBA Find Differences Between Two Arrays

The following post will detail how to compare the contents of two arrays (two-dimensional) and highlight cells in the update table where there are differences.  The use case revolves around comparing and updated table against the original to see where cell values have changed.  If a given value has indeed changed, the macro will highlight the background color so it will stand out visually.

Excel:  Version 2013

Excel VBA Find Differences Between Two Arrays

You have the following two tabs in an Excel Workbook

Original

Excel VBA Find Differences Between Two Arrays

 

Current

 

Excel VBA Find Differences Between Two Arrays

 

Next, insert the following macro.  This macro will compare the content of each tab (using two-dimensional arrays), and highlight the background color (Aqua) of cells in the Current tab, where the value has changed.

 

Execute the macro, and you will see the following on the Current tab:

 

Excel VBA Find Differences Between Two Arrays

 

Feel free to modify the macro code to suit your needs!

 

Here is the Excel Macro-Enabled Workbook for the above post

Excel VBA Find Differences Between Two Arrays

 

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