I have several workbooks in folder C:\Parts &Service where the data needs to be updated with downloaded files in C:\extract
I have a macro that allows me to open up a workbook in c:\Parts & SVC Sales. One opened I then need to select the appropriate file in C:\extract
Sub Update_Workbooks()
ChDir ("C:\Parts & SVC Sales")
Application.DisplayAlerts = False
fPath = Application.GetOpenFilename
fName = Mid(fPath, Len("C:\Parts & SVC Sales") + 2)
Workbooks.Open (fPath)
Application.Run "'" & fName & "'!Auto_Update"
ActiveWorkbook.Save
ActiveWorkbook.Close
CloseCSV
End Sub
Display More
The are two types of workbooks in C:\Parts & SVC Sales "Parts Sales" and "service Sales" . The branch name is at the beginning of the file name
Instead of opening up each file individually in C:\Parts & SVC Sales and selecting the appropriate csv file in C:/extract using the Update_Macro, I would like the macro to open up all the files in the directory C:\Parts & SVC Sales and update each of these with the appropriate csv file in C:\extract
The name and description type must match the csv files and then updated eg Br1 Parts Sales to be updated with csv file Br1 Salesperson 01-07-2014 (the date in the file is not important for match the parts file -the branch name for eg BR1 and "salesperson is) i.e Br1 Parts Sales must select BR1 Salesperson 01-07-2014
BR1 Service Sales Must be updated with Br1 Service order repair register.csv (branch name for eg Br1 in this instance name and Service order repair register (pertain to Service Sales) is important)
Br2 Parts Sales to be updated with Br2 Salesperson
Br2 Service Sales must be updated with Br2 Service order repair register etc
I have also posted on Mr Excel.com
http://www.mrexcel.com/forum/e…5-updating-workbooks.html
Your assistance in resolving this is most appreciated