Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbook name changes
I need to use a workbook name in a macro but the name of the workbook changes
daily with the date. e.g. done101308.xlsx today will be done101408.xlsx tomorrow. Is there a way to use a workbook name in a macro but have the part of the name that is the date automatically change with the computer date? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbook name changes
Hi
Maybe this will help you: CurDate = Day(Date) & Month(Date) & Right(Year(Date), 2) WBname = "done" & CurDate & ".xlsx" Regards, Per On 13 Okt., 23:01, aileen wrote: I need to use a workbook name in a macro but the name of the workbook changes daily with the date. *e.g. done101308.xlsx today will be done101408.xlsx tomorrow. *Is there a way to use a workbook name in a macro but have the part of the name that is the date automatically change with the computer date? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbook name changes
Hello,
Thanks for the quick response. Should I be able to use WBname as the workbook name throughout the rest of the macro? e.g. CurDate = Day(Date) & Month(Date) & Right(Year(Date), 2) WBname = "done" & CurDate & ".xlsx" Workbooks.Open Filename:="C:\Check\Done\WBname" I am getting a runtime error when I do this, so I am obviously still doing something wrong. Any help is greatly appreciated. "Per Jessen" wrote: Hi Maybe this will help you: CurDate = Day(Date) & Month(Date) & Right(Year(Date), 2) WBname = "done" & CurDate & ".xlsx" Regards, Per On 13 Okt., 23:01, aileen wrote: I need to use a workbook name in a macro but the name of the workbook changes daily with the date. e.g. done101308.xlsx today will be done101408.xlsx tomorrow. Is there a way to use a workbook name in a macro but have the part of the name that is the date automatically change with the computer date? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbook name changes
This worked perfectly once I figured out the step I was doing wrong. Thanks
for your help. "Per Jessen" wrote: Hi Maybe this will help you: CurDate = Day(Date) & Month(Date) & Right(Year(Date), 2) WBname = "done" & CurDate & ".xlsx" Regards, Per On 13 Okt., 23:01, aileen wrote: I need to use a workbook name in a macro but the name of the workbook changes daily with the date. e.g. done101308.xlsx today will be done101408.xlsx tomorrow. Is there a way to use a workbook name in a macro but have the part of the name that is the date automatically change with the computer date? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exceeding 65K of defined names within workbook causes workbook to go into repair mode when it is opened | Excel Programming | |||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook | Excel Programming | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |