Re: Name a File via Code Q
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Sat, 07 Feb 2009 07:22:25 -0600
If the extension is always 4 characters long (.xls), then you could just avoid
them
tempfilename = "part of " & right(sourcewb.name, len(sourcewb.name)-3) & ....
But if you're using xl2007 or weird extensions, then this wouldn't work.
You could use instrrev (xl2k and above) to look for the last dot and strip the
characters based on that position. But even that assumes that the filename has
an extension.
Seanie wrote:
I have a file that I create from a source document and name the file
basd on below. Which gives a new file name of "Part of name of
original file.xls 07-feb-09 1-30~.xls"
TempFileName = "Part of " & Sourcewb.Name & " " & Format(Now, "dd-mmm-
yy h-mm") & "~"
How could I exclude from the new file name the ext of the original
file? (the first.xls in my example above)
eg. what I want to appear is "Part of name of original file 07-feb-09
1-30~.xls
--
Dave Peterson
.
- Follow-Ups:
- Re: Name a File via Code Q
- From: Dave Peterson
- Re: Name a File via Code Q
- References:
- Name a File via Code Q
- From: Seanie
- Name a File via Code Q
- Prev by Date: Re: Transferring of certain cells from one workbk to another
- Next by Date: Re: Name a File via Code Q
- Previous by thread: Name a File via Code Q
- Next by thread: Re: Name a File via Code Q
- Index(es):
Relevant Pages
|
Loading