#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel 2007 file in 2003 creates very large file Jon Pearce Excel Discussion (Misc queries) 2 July 16th 09 07:20 PM
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met JMay Excel Discussion (Misc queries) 2 June 17th 07 04:37 PM
Saving worksheet in new file with date AND cell value as file name michaelberrier Excel Discussion (Misc queries) 4 May 26th 06 08:05 PM
Text file saving, setting file origin mauddib Excel Discussion (Misc queries) 0 May 25th 06 02:50 PM
How do I stop Excel 2000 from saving file history from file that . Cathy Excel Discussion (Misc queries) 0 March 29th 05 03:27 PM


All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"