Macro to automaticaly save a book under an specific name

  • Thread starter Thread starter Marissa
  • Start date Start date
M

Marissa

Ok, this is the problem.

I have a book in excel for sales. The work is almost
done, all the macros work wonders, the process of sales
from the moment of getting orders until the moment the
product has been delivered works fine.

The thing is that what I need is that when I close this
book I want it to be saved automaticaly under a specific
name (that would be the No of Order from the client, that
appears in one of the pages of the document, in a
predeterminated cell all the time).

Is ther ea way to make this happen through a macro or
something? And when I save the book that it saves itself
always on a specific file in the computer?

Any clues?

Marissa
 
Maybe you could provide another macro:

With ThisWorkbook
.SaveAs Filename:=.Worksheets("sheet1").Range("a1").Value & ".xls", _
FileFormat:=xlNormal
End With

(with a bunch of testing to see if things were filled in correctly)

And you could add the path you want, too:

With ThisWorkbook
.SaveAs Filename:=.path & "\" & _
.Worksheets("sheet1").Range("a1").Value & ".xls", _
FileFormat:=xlNormal
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top