unique file names
Assuming you want a meaningful name, the usual approach is to include a
time-stamp as the final part of the name, e.g.
NewName = "MyWorkbook" & Format$(Now(),"yyyymmddhhmmss") & ".xls"
which has a resolution of 1 second. Now, before trying to save with that name,
you use the Dir$ function to see if that name as already been used. If so,
append a letter to make it
NewName = "MyWorkbook" & Format$(Now(),"yyyymmddhhmmss") & "A.xls"
And of course you have to see if that name is available, and if not, go to B,
etc. Generally you would use a loop at this point.
On Tue, 12 Oct 2004 14:40:29 -0500, Graeme R
wrote:
hoping someone can help me. I need to find out how to export selected
data from excel, into a new sheet, and then save numerous times, each
time with a unique file name. Anyone know what is the easiest way of
doing this? I have macro set up to cut and paste secial data form the
template, but as I am new to this, and frankly dumb, i am having
trouble finding help on unique file names.
Help is appreciated if available, otherwise insanity looms large!!
Thanks in advance
|