![]() If Range("B" & amp amp amp amp amp amp amp compRow) = Range("B" & amp amp amp amp amp amp amp rowNo) Then 'If a match is found in Column A, check correspoding values of column B If Range("A" & amp amp amp compRow) = Range("A" & amp amp amp amp amp amp amp rowNo) Then 'Check if a match is found in Column A for the current rowNo 'For each rowNo, loop through all the remaining rows Sub highlightDuplicateRows()ĭim lastRow As Integer, compRow As Integer, rowNo As Integer The comments in the code below will help you follow through the code. For this, we will be using two for loops – first one to loop through all the rows and second to find a match for the current row. For each row, you need to check if there is another row with the exact same data. Consider you have 3 columns of data with few duplicate rows as seen below:Īnd you need to highlight the rows that are not unique. As there is no direct way to achieve this, we need to loop through all the rows in the data. In this article we will look at how to find duplicate entries across columns using Excel VBA.
0 Comments
Leave a Reply. |