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
 
Back
Top