View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pvm3911 pvm3911 is offline
external usenet poster
 
Posts: 1
Default Saving to subdirectory using date()


I have a night audit report named DSR(v1.20) in a directory name
Naudit. There's a subdirectory named Bak. I've tried without success t
create a macro that will save the DSR to Bak as a two-digit numbe
consisting of yesterday's date and overwrite any previous file of th
same name. E.g. Around 04:00 on the 22nd, when the DSR for the 21st i
complete, I'd like the operator to hit Ctrl+B, and the DSR will b
saved in Bak as '21' (taking today's date minus 1). Thus, Bak wil
contain DSRs for '01' thru '31', and on the 1st of the next month (er
actually, at 04:00 on the 2nd) the old '01' will be overwritten by th
new one.

Can this be done with a macro, or does it call for a VBA program, or
DOS batchfile? Can anyone suggest a pre-existing routine that I ca
modify to achieve my desired result? (Possible problem: at 04:00 on th
1st, the filename will vary; it can be either '30' or '31' [or '28' o
'29'], so instead of using date() it may be necessary to get input fro
the operator)

--
pvm391
-----------------------------------------------------------------------
pvm3911's Profile: http://www.excelforum.com/member.php...fo&userid=2654
View this thread: http://www.excelforum.com/showthread.php?threadid=39846