Macro Button To Save & Close A Workbook - Add This Function To a Button Or Quick Access Toolbar

Опубликовано: 30 Март 2026
на канале: Excellently
913
1

Here I cover how to write a macro that will allow you to quickly close your Excel file by combining saving and closing a Workbook into one process. Use the below code to save and close your workbooks.

====== PROFILE ======
https://hubpages.com/@joshuacrowder

======== CODE ========
Sub Saveandclose()
ActiveWorkbook.Close SaveChanges:=True
End Sub

===== CHAPTERS =====
00:00 Start
00:26 Add Developer Tab (if applicable)
00:48 Write Code In Visual Basic Module
01:58 Save As Macro-Enabled Workbook

======== TAGS ========
#msexcel #excel #excelmacro #excelvba #exceltutorial #exceltutorial #exceltips #excelautomation
#microsoftexcel #macrobutton #visualbasic