Comapre two worksheet with multiple column dynamically excel vba

In this lession We will learn How to compare two worksheet dynamically with multiple column.
Here I will insert different size datatable into sheet1 & sheet2. I will use checkboxes to compare data.
I want that when I clicked on CheckBox1 then It will compare data from sheet1 by sheet2 & highlight by yellow color. 
VBA ColorIndex Code List...

VBA ColorIndex Examples

Set Cell Background Color

Set Cell Font Color

Set Cell Borders Color

Get Cell Background ColorIndex

Set a Cell Background Color to Another Cell’s Color

VBA Codes thats are used in this tutorials...


Codes Discussion :
declare two variables to set the worsheets

Declare a variable as long to find out last row number. Here I declared the variables by x and used it to find out the last non-blank row number based on Column A

Declare another variable to input column number whose cells value will be compared

use a loop function with a variables to check each and every cell value 

Now use countif function to to find out duplicate values. and after finding duplicate value then change the background color for those cell only which are duplicate..

VBA codes for CheckBox2.....


VBA codes for CheckBox3..

VBA Codes for CheckBox4 Where I compare all data for sheet1 with sheet2's particular cell values..

No comments:

Post a Comment