I have 2 workbooks Say Workbook 1 and workbook 2. Need to put a filter in Workbook 2 with filter "INTDN" in column G and copy column "O" and column "J" in workbook 1, column "B" and Column "I" respectively.
Can any one give a VBA code for this?
Workbook and worksheet name can be anything depending on the source however format will be same always.
Some more information for your reference:-
Workbook 2 Put a filter in Row 12 column G :- "INTDN"
Workbook 1 Paste copied data from column "O" to cell B25 downwards. Paste copied data from column "J" to cell I25 downwards.
I will then assign this Macro to every worksheet I need this to work.
I am a novice in VBA. Appreciate your assistance.
This is what I could write:-
Sub CopyData()
'
' CopyData Macro
'
'
Windows("Book1 (8).xlsx").Activate
Range("A12").Select
Selection.AutoFilter
Range("G12").Select
ActiveSheet.Range("$A$12:$AV$72").AutoFilter Field:=7, Criteria1:="INTDV"
Range("O35").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("DebitNotes.xlsm").Activate
ActiveSheet.Paste
Range("I25").Select
Windows("Book1 (8).xlsx").Activate
Range("J35").Select
Range(Selection, Selection.End(xlDown)).Select
Range("J35:J72").Select
Application.CutCopyMode = False
Selection.Copy
Windows("DebitNotes.xlsm").Activate
ActiveSheet.Paste
End Sub