Hi everyone,
I am trying to copy some data from an open file. I have some code, works great but i'd like to make it work for different file names.
The "Supplier_report.csv" file is folowed by a date (like Supplier_report_211215.csv ), I always need tot remove it manually in order for the macro to work.
Any sugestions on the below code to cvhange that ? I have tried wildcards and a few other things but my VBA is quite basic.
Any help is highly apreciated !
I am trying to copy some data from an open file. I have some code, works great but i'd like to make it work for different file names.
The "Supplier_report.csv" file is folowed by a date (like Supplier_report_211215.csv ), I always need tot remove it manually in order for the macro to work.
Any sugestions on the below code to cvhange that ? I have tried wildcards and a few other things but my VBA is quite basic.
Any help is highly apreciated !
Code:
Sub GetData()
Windows("Supplier_Report.CSV").Activate
Range("A:A,C:C,E:E,F:F,G:G,H:H,I:I,J:J,L:L,u:u,w:w,x:x,y:y,z:z,aa:aa,ab:ab,ad:ad,ae:ae,af:af,ag:ag,am:am,an:an,ap:ap,ar:ar,av:av,aw:aw,ay:ay,az:az,ba:ba,bb:bb,bc:bc,bf:bf,bh:bh,bi:bi,bj:bj,bl:bl,bm:bm,bu:bu").Select
Range("BU1").Activate
Selection.Copy
Windows("VSU Pivot file.xlsb").Activate
Worksheets("VendorExtract").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub