M
Michael J. Malinsky
Can anyone shorten this?
newfilename = ThisWorkbook.Path & "\" & Format(Month(DateAdd("m", 1,
(MonthName(Val(Left(ThisWorkbook.Name, 2))) & " 1, " &
(Mid(ThisWorkbook.Name, 3, 4))))), "00") & Format(Year(DateAdd("m", 1,
(MonthName(Val(Left(ThisWorkbook.Name, 2))) & " 1, " &
(Mid(ThisWorkbook.Name, 3, 4))))), "00") & ".xls"
Basically, if my open file is named 032004.xls (representing mmyyyy.xls) and
I click a button on a userform I want to empty certain areas of my workbook
(which I can do) then save the file as 042004.xls, essentially creating a
new template for the following month. I need to do this as there is
information in the file that would be updated on occasion and I'd like to
keep rolling this forward rather than having to update a "master" template.
Using a database as a backend cannot be part of a solution (although it
would make life easier, I suppose, it is an unavailable option)
TIA
--
Michael J. Malinsky
Pittsburgh, PA
"I was gratified to be able to answer promptly,
and I did. I said I didn't know." -- Mark Twain
newfilename = ThisWorkbook.Path & "\" & Format(Month(DateAdd("m", 1,
(MonthName(Val(Left(ThisWorkbook.Name, 2))) & " 1, " &
(Mid(ThisWorkbook.Name, 3, 4))))), "00") & Format(Year(DateAdd("m", 1,
(MonthName(Val(Left(ThisWorkbook.Name, 2))) & " 1, " &
(Mid(ThisWorkbook.Name, 3, 4))))), "00") & ".xls"
Basically, if my open file is named 032004.xls (representing mmyyyy.xls) and
I click a button on a userform I want to empty certain areas of my workbook
(which I can do) then save the file as 042004.xls, essentially creating a
new template for the following month. I need to do this as there is
information in the file that would be updated on occasion and I'd like to
keep rolling this forward rather than having to update a "master" template.
Using a database as a backend cannot be part of a solution (although it
would make life easier, I suppose, it is an unavailable option)
TIA
--
Michael J. Malinsky
Pittsburgh, PA
"I was gratified to be able to answer promptly,
and I did. I said I didn't know." -- Mark Twain