Narasimharao,
I have amended the code you have. I have removed some lines to speed up the code. On my PC, it took just over 31 seconds to run the code.
I perhaps could have come up with different code, but not only your request is not clear, but keep changing too. So, this code is easy to amend it your self and should stick with it.
Option Explicit
Sub Find_dup_po_number()
Dim ms As Worksheet, eor1&, eor2&, x&, dTimer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
dTimer = Timer
Set ms = Sheets("Duplicate")
ms.Range("a10:I" & Rows.Count).ClearContents
With Sheets("podata")
eor1 = .Cells(.Rows.Count, 1).End(xlUp).row
For x = 5 To eor1
If WorksheetFunction.CountIf(.Range("Q:Q"), .Range("Q" & x)) > 1 Then
eor2 = ms.Cells(Rows.Count, 1).End(xlUp).row + 1
.Range("I" & x).Copy ms.Range("A" & eor2)
.Range("C" & x & ":H" & x).Copy ms.Range("B" & eor2)
.Range("K" & x).Copy ms.Range("I" & eor2)
.Range("J" & x).Copy ms.Range("H" & eor2)
End If
Next x
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
MsgBox "Code version took: " & Timer - dTimer & " seconds"
MsgBox "Found Duplicate Purchase order number. Please investigate before continuing!"
End Sub
Bookmarks