i am finding the differences between 2 worksheets, the code is as follows:
For Each mycell In ActiveWorkbook.Worksheets(shtSheet2).UsedRange If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet1).Cells(mycell.Row, mycell.Column).Value Then mycell.Interior.Color = vbYellow difference = difference + 1 End If If mycell.Value = ActiveWorkbook.Worksheets(shtSheet1).Cells(mycell.Row, mycell.Column).Value Then matches = matches + 1 End If
When the values in the cells do not match it highlights that cell yellow and increments the count so I know the total amount of differences.
I have the headers Department, Name, Sales, Date Start, Date end. How can I return the amount of differences for the columns?
Differences department : 3 sales : 0 Date Start : 1 Date end : 2