ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   saving file (https://www.excelbanter.com/excel-programming/294650-saving-file.html)

nathan

saving file
 
Hello

I have a cell with a date in it. I would like to save the workbook with the file name the same as the date PLUS one day. I can save the file using the date in the cell without any problems using

d = Format(Range("c1"), "mm-d-yy"
ActiveWorkbook.SaveAs Filename:=
"c\GM Capital Group\Portfolio\" & d & ".xls

But I can't figure out how to save the same file with the next day's. i.e. if c1 = 04-08-2004 then save the file with file name 04-09-2004.xls. I know there is the "DateAdd" function, but I can't figure out how to incorporate it

Ideally, I would like to have it use the next business day, taking into account weekends and holidays, but that might be asking for too much..

Any thoughts
Thanks, Natha



Frank Kabel

saving file
 
Hi
change the line
d = Format(Range("c1"), "mm-d-yy")

to
d = Format(Range("c1").value+1, "mm-d-yy")


--
Regards
Frank Kabel
Frankfurt, Germany


nathan wrote:
Hello,

I have a cell with a date in it. I would like to save the workbook
with the file name the same as the date PLUS one day. I can save the
file using the date in the cell without any problems using:

d = Format(Range("c1"), "mm-d-yy")
ActiveWorkbook.SaveAs Filename:= _
"c\GM Capital Group\Portfolio\" & d & ".xls"

But I can't figure out how to save the same file with the next day's.
i.e. if c1 = 04-08-2004 then save the file with file name
04-09-2004.xls. I know there is the "DateAdd" function, but I can't
figure out how to incorporate it.

Ideally, I would like to have it use the next business day, taking
into account weekends and holidays, but that might be asking for too
much...

Any thoughts?
Thanks, Nathan




All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com