How to save and Close an Excel Sheet using Macro
Here I am going to give an idea how we can save and close the current excel sheet using Macro. This function can be written in the Module and can be called any where in the program where we want to save the Excel and Close it. The below code will save and close only the Workbook where the code is running.
Dim Wb As Workbook
For Each Wb In Workbooks
If Wb.Name <> ThisWorkbook.Name Then
Note: Above code will save and close the only workbook, which you have selected; It means where you are running this macro.