Hi Team,
I am using below macro to auto filter on col D and Col F on worksheet "confirms" with below criterias and then trying to copy col P and Col S filtered data to another worksheet names "Non=Cash Trades".
the below code is autofiltering only col D with "N" and Col F with "COD" not "F/D" and copy function is not working at all. Please help.
Sub Copy()
Dim i As Long, LR As Long
Dim sht, sht1 As Worksheet
Set sht = ActiveWorkbook.Worksheets("confirms")
Set sht1 = ActiveWorkbook.Worksheets("NON-CASH Trades")
sht.Range("A:S").AutoFilter Field:=4, Criteria1:=Array("N")
sht.Range("A:S").AutoFilter Field:=6, Criteria1:=Array("F/D", "COD")
sht.Range("P2:P5000").Copy
sht1.Range("A4:A5000").PasteSpecial xlPasteValues
sht.Range("S2:S5000").Copy
sht1.Range("C4:C5000").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub
I am using below macro to auto filter on col D and Col F on worksheet "confirms" with below criterias and then trying to copy col P and Col S filtered data to another worksheet names "Non=Cash Trades".
the below code is autofiltering only col D with "N" and Col F with "COD" not "F/D" and copy function is not working at all. Please help.
Sub Copy()
Dim i As Long, LR As Long
Dim sht, sht1 As Worksheet
Set sht = ActiveWorkbook.Worksheets("confirms")
Set sht1 = ActiveWorkbook.Worksheets("NON-CASH Trades")
sht.Range("A:S").AutoFilter Field:=4, Criteria1:=Array("N")
sht.Range("A:S").AutoFilter Field:=6, Criteria1:=Array("F/D", "COD")
sht.Range("P2:P5000").Copy
sht1.Range("A4:A5000").PasteSpecial xlPasteValues
sht.Range("S2:S5000").Copy
sht1.Range("C4:C5000").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub