VBA code to save excel sheet

  • Thread starter Thread starter KKurse
  • Start date Start date
K

KKurse

Hi ,

I am using VBA to display a form and let the user enter the data into
excel sheet. I have text box with the customer name. I would like to
save the file using the customer name. So if my customer is James
Bond
I would like the file saved to be as JamesBond.xls

Can anybody help me with this

Appreciate your help


Suhas
 
This will work if JamesBond is in cell A1 if not replace A1 with what you need

Sub Test
If Range("A1").Value = "" Then End
ActiveWorkbook.SaveAs Filename: = Range("A1").Value
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