Hi Lexusap,
I found another problem with macro run. My POData sheet contains more than 25,000 rows. Macro run with existing code that is provided by you taking almost 10 Mins to complete. I tried to modify as follows:
Kindly suggest is there any alternative.
Best Regards,
Narasimharao
Application.ScreenUpdating = False
Sheets("DuplicatesofPO").Range("a2:I2000").ClearContents
Sheets("POData").Activate
eor1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For x = 5 To eor1 Step 1
Sheets("POData").Select
A = WorksheetFunction.CountIf(Range("I:I"), Range("I" & x))
If A = 1 Then
'Do nothing
Else
eor2 = Sheets("DuplicatesofPO").Cells(Rows.Count, 1).End(xlUp).Row
Range("I" & x).Copy Sheets("DuplicatesofPO").Range("A" & eor2 + 1)
Range("C" & x & ":H" & x).Copy Sheets("DuplicatesofPO").Range("B" & eor2 + 1)
Range("K" & x).Copy Sheets("DuplicatesofPO").Range("I" & eor2 + 1)
Range("J" & x).Copy Sheets("DuplicatesofPO").Range("H" & eor2 + 1)
End If
Next x
Application.ScreenUpdating = True
Sheets("DuplicatesofPO").Select
MsgBox "Found Duplicate Purchase order number. Please investigate before continuing!"
Bookmarks