View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default How to save file in a macro taking new name from cell contents?

Hi LowIQ,

Try:

'=============
Public Sub Tester004()
Dim sStr As String

sStr = ThisWorkbook.Sheets("Sheet1"). _
Range("A1").Value '<<=== CHANGE

ThisWorkbook.SaveAs Filename:=sStr & ".xls", _
FileFormat:=xlWorkbookNormal

End Sub
'<<=============


---
Regards,
Norman



"LowIQ" wrote in message
...
I want to Save-as a file from within a macro, taking the new name from the
worksheet's cell contents. I want to save an order form with a file name
based on the order number contained in a worksheet cell. My question is
how
to get the cell contents into the Save-as dialog box when the macro calls
the
Save-as function.
Thanks.