violaplayer
06-30-2015, 02:04 AM
Hi
I am new to excel VBA, sorry if question has been raised by the others but I am hoping if someone could show me the exact syntax for my requirement below.
I have 200 excel files which have been saved in different path, but each of the file has the same fields and format (cloned from the same template). For example
=====================================
myTemplate.xls
Header (cell A1-A4): "Order_No" | "Product_Name" | "Quantity" | "Purchase_Date"
Files Paths
C:\Documents\Peter\London_Branch1_myTemplate_31032015.xls
C:\Documents\Peter\London_Branch2_myTemplate_31032015.xls
C:\Documents\Peter\London_Branch3_myTemplate_31032015.xls
C:\Documents\David\NewYork_Branch1_myTemplate_31032015.xls
C:\Documents\David\NewYork_Branch2_myTemplate_31032015.xls
C:\Documents\John\HongKong_Branch1_myTemplate_31032015.xls
C:\Documents\John\HongKong_Branch2_myTemplate_31032015.xls
C:\Documents\Susan\Paris_Branch1_myTemplate_31032015.xls
...............
...............
...............
...............
=====================================
I would like to write a VBA which can be able to the followings
1) Open the first file "London_Branch1_myTemplate_31032015.xls"
2) Copy all the entered rows
3) Paste into a single master single workbook says Global_Orders.xls
4) repeat step 1 to 3 for the second file until all 200 files. Basically it will stack up all the entries from each file into one big table.
Thank you very much
I am new to excel VBA, sorry if question has been raised by the others but I am hoping if someone could show me the exact syntax for my requirement below.
I have 200 excel files which have been saved in different path, but each of the file has the same fields and format (cloned from the same template). For example
=====================================
myTemplate.xls
Header (cell A1-A4): "Order_No" | "Product_Name" | "Quantity" | "Purchase_Date"
Files Paths
C:\Documents\Peter\London_Branch1_myTemplate_31032015.xls
C:\Documents\Peter\London_Branch2_myTemplate_31032015.xls
C:\Documents\Peter\London_Branch3_myTemplate_31032015.xls
C:\Documents\David\NewYork_Branch1_myTemplate_31032015.xls
C:\Documents\David\NewYork_Branch2_myTemplate_31032015.xls
C:\Documents\John\HongKong_Branch1_myTemplate_31032015.xls
C:\Documents\John\HongKong_Branch2_myTemplate_31032015.xls
C:\Documents\Susan\Paris_Branch1_myTemplate_31032015.xls
...............
...............
...............
...............
=====================================
I would like to write a VBA which can be able to the followings
1) Open the first file "London_Branch1_myTemplate_31032015.xls"
2) Copy all the entered rows
3) Paste into a single master single workbook says Global_Orders.xls
4) repeat step 1 to 3 for the second file until all 200 files. Basically it will stack up all the entries from each file into one big table.
Thank you very much