What VBA code do I need to add to the end of an existing sub to save the active workbook as "finalo开发者_如何学运维utput.xls" and then automatically close the workbook without saving changes?
You could use something as simple as this, which I put in another workbook and executed from the Tools...Macros menu (Alt+F8) after activating the workbook to be saved.
Public Sub SaveAsAndClose()
ActiveWorkbook.SaveAs "finaloutput.xls"
ActiveWorkbook.Close
End Sub
精彩评论