Save a file using the name in a specific cell

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have created a macro for a button that will open a new
workbook and copy a range of cells into it. It then saves
the file but only saves it as the name I put in the macro.
I would like to referance a specific cell in my original
workbook and use that as the name.

Is that possible in Excel?
 
Try this Alex

Sub test()
ActiveWorkbook.SaveAs ThisWorkbook.Sheets("Sheet1").Range("a1") & ".xls"
End Sub
 
Thanks Ron, it worked great.
Is there a addition I could make to it that would make the
file save to a specific network directory as well?
 
Try this

ActiveWorkbook.SaveAs "fill in your path here" & _
ThisWorkbook.Sheets("Sheet1").Range("a1") & ".xls"
 
Back
Top