View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Trying to autopopulate a Save as filename

if lcase(right(filetoopen,4)) = ".xls" then
filetoopen = left(filetoopen,len(filetoopen)-4))
end if

filetoopen = filetoopen & "Cathy" & ".xls" 'include the .xls?



Cathy W wrote:

Hello. I have a template that opens, asks the user to select a file to get
values from, gets values from that file, and then automatically pops up the
save as dialog box. I want to put a filename there for the user so all they
have to do is choose save. I just want to add a string to the filename that
they opened to get values from. That value is stored in a variable called
fileToOpen and decalred as Variant. The problem I am having is that if I say:

fileToOpen & " Cathy"

it puts the Cathy after the whole filename like this: Todays Report.xls
Cathy.

I need it to drop the .xls and just add " Cathy".

Confused.....Hope someone can help.

Cathy


--

Dave Peterson