Can someone tell me what this code means? I am trying to use it to compare 2 worksheets. Want to know how they are alike and how they are different. The code was obtained from 'Experts Exchange'. It works, I just don't understand how. The gentleman from 'Experts Exchange' explaination was too technical or I am too hardheaded (probably the latter). If anyone would care to try to explain I will appreciate it.
Sub mPartNumber()
Static bFound
Dim c As Range, mlRange As Range
'I hope this is not read but is a comment
For Each c In Sheets("PI").Range("A2:A" & Sheets("PI").Range("A65536").End(xlUp).Row).Cells
If Application.WorksheetFunction.CountIf(Sheets("ML").Range _
("B2:B" & Sheets("PI").Range("B65536").End(xlUp).Row), c.Value) > 0 Then
c.EntireRow.Copy Destination:=Worksheets("PI=ML").Rows _
(Sheets("PI=ML").Range("A65536").End(xlUp).Row + 1)
bFound = True
End If
Next c
For Each c In Sheets("ML").Range("B2:B" & Sheets("ML").Range("B65536").End(xlUp).Row).Cells
If Application.WorksheetFunction.CountIf(Sheets("PI").Range("A2:A" & Sheets("PI") _
.Range("A65536").End(xlUp).Row), c.Value) = 0 Then
c.EntireRow.Copy Destination:=Worksheets("PI not=ML").Rows _
(Sheets("PI not=ML").Range("B65536").End(xlUp).Row + 1)
End If
Next c
End Sub
Bookmarks