Hey there,
I am attempting to write code that does the following:
Within a excel macro enabled file, create a new worksheet for every day of the month and names the worksheet for each day in the format of something like (“Tues. 8-28-07 CA”). That is, I will create a file called “DailySpeningListAUG.xls” that contains this code. Run the code and have it create an individual sheet for the workdays (Mon thru Friday) within August. Then make a copy of this file, run an existing code DeleteAllWorksheets and then rename “DailySpeningListCurrent.xls”.
This I’ll run this code to create all the necessary tabs for the month of September.
Each sheet added will be a copy of an existing Sheet(“SpendListTemplate”) from a Template file located at a file_path.
Here is what I have so far but I really don’t know how to create the add sheet(S) dependant on workdays in month and rename then.
It opens the Tmeplate file and copies it to the Monthly’s CURRENT file.
Thanks for the help.
Terry
I am attempting to write code that does the following:
Within a excel macro enabled file, create a new worksheet for every day of the month and names the worksheet for each day in the format of something like (“Tues. 8-28-07 CA”). That is, I will create a file called “DailySpeningListAUG.xls” that contains this code. Run the code and have it create an individual sheet for the workdays (Mon thru Friday) within August. Then make a copy of this file, run an existing code DeleteAllWorksheets and then rename “DailySpeningListCurrent.xls”.
This I’ll run this code to create all the necessary tabs for the month of September.
Each sheet added will be a copy of an existing Sheet(“SpendListTemplate”) from a Template file located at a file_path.
Here is what I have so far but I really don’t know how to create the add sheet(S) dependant on workdays in month and rename then.
It opens the Tmeplate file and copies it to the Monthly’s CURRENT file.
Thanks for the help.
Terry
Code:
Dim lookupfilename As String
lookupfilename = "C:\Users\Terry\Documents\CPS Automation Tools\OrderFormCreator\DailySpendTemplateFile.xls"
Workbooks.Open lookupfilename
Workbooks("DailySpendTemplateFile.xls").Activate
Workbooks("DailySpendTemplateFile.xls").Sheets("SpendListTemplate").Copy _
After:=Workbooks("DailySpendingListCurrent.xls"). _
Sheets(Workbooks("DailySpendingListCurrent.xls").Sheets.Count)