It executes much faster than a normal comparison. WsI.Cells(iRow, 1).Interior.Color = vbYellow If (wsI.Range("B1:B" & iTotRecsB), Val1) > 0 Then WsI.Cells(iRow, 1).Interior.Color = vbWhite ITotRecsB = wsI.Range("B" & Rows.Count).End(xlUp).Row ITotRecsA = wsI.Range("A" & Rows.Count).End(xlUp).Row Set wsI = ThisWorkbook.Sheets("InputSheet") Public Sub Compare_Two_Columns_Highlight_Duplicates()ĭim iRow As Double, oRow As Double, wsI As Worksheetĭim iTotRecsA As Double, iTotRecsB As Double To compare a huge volume of data in your Excel sheet, use this method to find duplicate values and report the differences. There are also possible chances that Excel application will hang in middle of execution & result in data loss. In case, if you have huge volume of data, then the above loop will keep on execute for long hours or days to complete. In Excel VBA, this can be done by plain comparison of each cell with two for loops, which is very efficient for low volume of data. If this same process has to be done for A->B comparison, then the formula should be reversed as ‘=countif(“$B:$B,$A1)’ Compare & Find duplicate entries in Two columns with Excel VBA Macro The data in Column C can be filtered for unique or duplicate entries. Now we have the comparison data in Column C for B->A verification.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |