Hi Guys,
I'm having some issues trying to run the macro below. I'm trying to copied the filter data from wbI to the each tab on another workbook (tickets). i seem to have missed out something but i can't figure it out. Much appreciated if someone could shed some light. Thanks!
I'm having some issues trying to run the macro below. I'm trying to copied the filter data from wbI to the each tab on another workbook (tickets). i seem to have missed out something but i can't figure it out. Much appreciated if someone could shed some light. Thanks!
Code:
Sub Trial()
SearchCol = "Portfolio"
Dim rng1 As Range
Set rng1 = ActiveSheet.UsedRange.Find(SearchCol, , xlValues, xlWhole)
Dim wbI As Workbook
Dim wsI As Worksheet
Dim c(1 To 5) As String
c(1) = "LDN"
c(2) = "TKY"
c(3) = "NY4"
c(4) = "POPNY4"
c(5) = "POP Swap"
Dim ws(1 To 5) As Worksheet
ws(1) = Workbooks("tickets").Worksheets("T-Data")
ws(2) = Workbooks("tickets").Worksheets("TY -Data")
ws(3) = Workbooks("tickets").Worksheets("NY -Data")
ws(4) = Workbooks("tickets").Worksheets("POPNY4 -Data")
ws(5) = Workbooks("tickets").Worksheets("POPSWOP -Data")
Set wbI = ActiveWorkbook
Set wsI = wbI.Sheets("BNP")
Dim counter As Integer
For counter = 1 To 5
Workbooks("Fx_Activity.csv").Activate
Range("a1").AutoFilter Field:=rng1.Column, Criteria1:=c(counter)
wsI.Range("a1").CurrentRegion.Copy
ws(counter).Range("a1").PasteSpecial xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Next
End Sub