How to call a filename as per information in a cell when using `save as`

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I wish to open a templete and input information then when
I click on the save button it saves it and calls the file
the same name as information in a particular cell. Is this
Poss.
 
Hi
put the following code in your workbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As _
Boolean)
dim fname
application.enableevents=false
fname=me.worksheets("sheet1").range("A1").value
fname=fname&".xls"
me.savesas fname
application.enableevents=true
Cancel = True
End Sub
 

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