Saving a file with a name generated by cell values

  • Thread starter Thread starter analyst
  • Start date Start date
A

analyst

Hi,

I'm building a database of customer enquiries. The macro i have writte
extracts data from the user input cells and places them in a hidde
sheet ready for submission to a central database via the templat
wizard.

What I'd like to do is, rather than having users on the network savin
the file as random names, to have some control over the naming proces
so that the customer's name and the date is picked up and turned int
the file name.

I've got as far as choosing the filename with this formula:-

=CONCATENATE(Customer,"_",Date,".xls")

which gives me the name. I also will have a standard path that thi
tags on to on the network.

Please can you tell me how to save the file based on this cell'
value?

Thanks

Analys
 
sPath = "C:\Myfiles\"

thisworkbook.SaveAs sPath & _
thisworkbook.worksheets("Sheet3").Range("A1").Value
 
hi,
tested
Sub Macro3()
Dim doda As Range
Set doda = Range("E6")
Range("E6").FormulaR1C1 = "test_Delete_later"
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\" & _
doda & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
 
I was looking for the exact same info today as well.

Works perfectly.

Thank
 
Just one more thing - is there a line of code which can be inserted int
that macro that will prompt the template to send the data to th
database or update the existing record
 

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