Dummy Excel
Well-known Member
- Joined
- Sep 21, 2005
- Messages
- 1,004
- Office Version
- 2019
- 2010
- 2007
- Platform
- Windows
Hi All,
I have created a macro to format some raw data from our system. When we receive the data from our system it always has a new file & worksheet name. So to get around this in the beginning i use the below code and then call the workbook/worksheet when required;
At the end of the report I rename my worksheet (k) to something more meaningful using the code below;
This all works great until I go and save my formatted report. Please see code below to save the report, although just before it saves the report, it changes the worksheet name from Dogs to Dogs OOS 170611
Any thoughts/help would be greatly appreciated
regards
Sam
I have created a macro to format some raw data from our system. When we receive the data from our system it always has a new file & worksheet name. So to get around this in the beginning i use the below code and then call the workbook/worksheet when required;
Code:
j = ActiveWorkbook.Name
K = ActiveSheet.Name
At the end of the report I rename my worksheet (k) to something more meaningful using the code below;
Code:
Sheets(K).Name = "Dogs"
This all works great until I go and save my formatted report. Please see code below to save the report, although just before it saves the report, it changes the worksheet name from Dogs to Dogs OOS 170611
Code:
filedate = InputBox("Enter today's date as ddmmyy", , "010111")
Filename = "Dogs OOS " & filedate
ActiveWorkbook.SaveAs Filename:="C:\Pets OOS Reports - Dogs\" & Filename & ".xls"
Any thoughts/help would be greatly appreciated
regards
Sam