Hi Guys,
I defo cant do this on my own and need your guys help. I have never looped through files and folders and therefore need your help please.
I have several of workbooks that i copy on a daily basis.
I rename each workbook Daily stats followed by the date
e.g
Daily Stats 01.11.2011
Daily Stats 02.11.2011
Daily Stats 03.11.2011
The complete File path is C:\Users\h\Documents\Daily Stats and then i have my workbooks in there (e.g - Daily Stats 01.11.2011)
My files are saves as .XLSM files
Now what i need is a macro to do this
Have a input box to say select date for file to search for (Say i input 03.11.2011).
Loop through my file path and folder and find the workbook which has the date 03.11.2011 and open that workbook. In that workbook there will always be 1 worksheet. I need to copy that worksheet and paste it in the worksheet named Data in the initial Workbook that i am working on.
Now if there is no match with that date then msgbox File dated ??? can not be found ENTER another date
If the date selected matches any of the dates in the workbook i am initially working on ....Sheets("List").Range("B4:B" & LastWsRow)
Then
MSGBOX the file has already been copied, ENTER another date to search for.
Please Please Please Help me Guys. I can never do this without you guys
I defo cant do this on my own and need your guys help. I have never looped through files and folders and therefore need your help please.
I have several of workbooks that i copy on a daily basis.
I rename each workbook Daily stats followed by the date
e.g
Daily Stats 01.11.2011
Daily Stats 02.11.2011
Daily Stats 03.11.2011
The complete File path is C:\Users\h\Documents\Daily Stats and then i have my workbooks in there (e.g - Daily Stats 01.11.2011)
My files are saves as .XLSM files
Now what i need is a macro to do this
Have a input box to say select date for file to search for (Say i input 03.11.2011).
Loop through my file path and folder and find the workbook which has the date 03.11.2011 and open that workbook. In that workbook there will always be 1 worksheet. I need to copy that worksheet and paste it in the worksheet named Data in the initial Workbook that i am working on.
Now if there is no match with that date then msgbox File dated ??? can not be found ENTER another date
If the date selected matches any of the dates in the workbook i am initially working on ....Sheets("List").Range("B4:B" & LastWsRow)
Then
MSGBOX the file has already been copied, ENTER another date to search for.
Please Please Please Help me Guys. I can never do this without you guys