Link to home
Start Free TrialLog in
Avatar of Ray
RayFlag for United States of America

asked on

Excel VBA Save as

Taking the easy way out and asking you smart peeps :-)

I have a variable in VBA called "filename"  
The filename value will be something like  "Bob blah blah 10.15.xlsm"... But it might be a .xls file, either way the file extension is already part of the variable.

What i want is to save as    filename (without extenstion)  &  "More Words Here" & filename (only the original extension)
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ray

ASKER

Sorry, was out for a long weekend :-)

Trying this today and bet it works!
Avatar of Ray

ASKER

Works perfect!

I converted it to one long string to use as the filename to save an updated copy of an exisiting/open file.

Left(filename, InStrRev(filename, ".", -1) - 1) & " - NEW ADDITION TO FILE NAME" & Right(filename, (Len(filename) - InStrRev(filename, ".", -1)) + 1)

Open in new window

Avatar of Ray

ASKER

Delivering excellent results, as usual!
Thanks Ray.. Always happy to help.. :-)

Saurabh...