Avatar of Ray
Ray
Flag 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)
Microsoft ExcelMicrosoft OfficeVisual Basic ClassicVBA

Avatar of undefined
Last Comment
Saurabh Singh Teotia

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Saurabh Singh Teotia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray

ASKER
Sorry, was out for a long weekend :-)

Trying this today and bet it works!
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

Ray

ASKER
Delivering excellent results, as usual!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Saurabh Singh Teotia

Thanks Ray.. Always happy to help.. :-)

Saurabh...