Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default unique file names


hoping someone can help me. I need to find out how to export selecte
data from excel, into a new sheet, and then save numerous times, eac
time with a unique file name. Anyone know what is the easiest way o
doing this? I have macro set up to cut and paste secial data form th
template, but as I am new to this, and frankly dumb, i am havin
trouble finding help on unique file names.

Help is appreciated if available, otherwise insanity looms large!!

Thanks in advanc

--
Graeme
-----------------------------------------------------------------------
Graeme R's Profile: http://www.excelforum.com/member.php...fo&userid=1523
View this thread: http://www.excelforum.com/showthread.php?threadid=26862

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


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
Counting Unique Names Karen Excel Worksheet Functions 2 November 19th 09 09:41 PM
Unique Names w/ Conditions Glempy Excel Worksheet Functions 2 September 7th 09 11:41 PM
counting unique names - again John K Excel Worksheet Functions 3 January 25th 08 09:42 PM
Finding unique names--then converting those names to unique number Proton Excel Discussion (Misc queries) 7 June 13th 07 10:22 PM
New Range containing Unique names only Steve Excel Programming 2 October 2nd 04 12:41 AM


All times are GMT +1. The time now is 09:06 AM.

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

About Us

"It's about Microsoft Excel"