Sub CopyRows()
Dim LR As Long, LR2 As Long, i As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Range("C" & i).Value <> Range("D" & i).Value Then
LR2 = WorksheetFunction.Min(5, Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Row + 1)
Rows(i).Copy Destination:=Sheets("Sheet2").Range("A" & LR2)
End If
Next i
End Sub
Place in a cell the formula countif and select the first cell in the first column and then the whole of the second column in the next step of the formula, then fill going down, this will give you a number and if only 1 then add a filter to show only 1 then you can copy the rows or cells.
If this works then you can record a macro to do most of this automatically.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.