View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Saving filename same as import filename

Activeworkbook.SaveAs Activeworkbook.Path & "\" & _
left(Activeworkbook.Filename, len(Activeworkbook.Filename)-4) & ".xls", _
fileformat:=xlWorkbookNormal

--
Regards,
Tom Ogilvy

"Matt" wrote in message
...
I have a macro that imports a txt file(test.txt) into an Excel spreadsheet

and then I want to save this file with the same name as the txt file(test)
obviously w/out the .txt. Any ideas? Thanks. Matt