VBA Code to close all workbooks all Workbooks in One Go
What is it:
This VBA Code will help you close all workbooks opened in the system in one go.
Why:
When you are creating an Excel Macro to create a consolidated report from multiple individual workbooks and after updating you want to close all the workbooks then this is the code will be a help.
How to close all workbooks in one go:
Step 1: Open the macro file or the excel where you want to put the code and press Alt + F11
Pin
Step 2: Copy and Paste the below code in the VBA editor window and Save the workbook.
Sub closeWorkbook()
Dim wb As Workbook
For Each wb In Workbooks
wb.Close SaveChanges:=True
Next wb
End Sub