Excel 2003 - A macro to exit excel

  • Thread starter Thread starter Alan_Malawi
  • Start date Start date
A

Alan_Malawi

Hi I need to create a macro that will first do a "save as" picking up a file
name from a cell on the worksheet and then will exit excel
 
Chage the reference of [a1] to the cell on your worksheet that has the name
you want to save as:

Sub SaveAndClose()
ActiveWorkbook.SaveAs Filename:= _
"C:\myDirectory\" & [a1] & ".xls"
ActiveWorkbook.Close
End Sub
 
Back
Top