View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
JulieD JulieD is offline
external usenet poster
 
Posts: 618
Default Macro to open SaveAs... and change filename to cell value

Hi Andy

i don't quite understand this, when i run the code the xlt turns into the
newly saved file (as shown in the title bar at the top) ... this is whether
i open the template itself or whether i open a new workbook based on the
template.

how are you running the code? could you cut & paste everything from the sub
to the end sub -also are you opening the xlt or a new workbook based on the
xlt (file / new - templates from my computer etc)

what version of excel are you running?

Cheers
JulieD

"Andy" wrote in message
...
Hi Julie

Thankyou very much. The file save worked well however I wanted to continue

working on the new saved as file straight away and had to open the file
manually.

When I normally Save As... manually the .xlt I am working on turns into a

..xls that I rename and relocate and I continue to work on the .xls.

Is there something I have forgotten?

"JulieD" wrote:

Hi Andy

something along the lines of

Dim fname As String
fname = "R:\" & Range("A1").Value & "\" & Range("A2").Value & ".xls"
ActiveWorkbook.SaveAs fname

this assumes that the folder for the company exists

Cheers
JulieD


"Andy" wrote in message
...
I have an excel.xlt file that I would like to fill in and save as an

..xls
with its filename and path based on particular cell values

For example A1 = Company A2 = QuoteNumber

The full Path/filename I would like to SaveAs...
is R:\Company\QuoteNumber.xls

I would appreciate if any could suggest a macro code to do this:)