Close an Excel workbook

How to close a single workbook using Excel, VBA and Shortcut methods

METHOD 1. Close an Excel workbook using the close button

EXCEL

Click Close workbook button

1. Click on the Close workbook button in the upper right corner of a workbook. Close workbook button

METHOD 2. Close an Excel workbook using the ribbon option

EXCEL

File tab > Close

1. Select the File tab. Select File tab

2. Click Close. Close workbook

METHOD 3. Close an Excel workbook using the Title Bar

EXCEL

Right-click on Title Bar > Click Close

1. Right-click on the Title Bar.
2. Click Close.
Right-click on the Title Bar and select Close

METHOD 1. Close an Excel workbook in which the VBA code is written

VBA

Sub Close_a_Workbook()
'close a workbook where this VBA code is written
ThisWorkbook.Close

End Sub

ADDITIONAL NOTES
Note 1: Using ThisWorkbook.Close will close the workbook in which the VBA code is written.

METHOD 2. Close a specific workbook

VBA

Sub Close_a_Specific_Workbook()
'close a workbook titled Examples.xlsx
Workbooks("Examples.xlsx").Close

End Sub

PREREQUISITES
Workbook Name: This example closes a workbook titled "Examples.xlsx", therefore if using the same VBA code you need to have a workbook titled "Examples.xlsx" open at the time of running this VBA code.
ADJUSTABLE PARAMETERS
Workbook Selection: Select the workbook that you want to close by changing the workbook name in the VBA code to any workbook that you want to close.

Close an Excel workbook

SHORTCUT

WINDOWS SHORTCUT

Ctrl
F4

NOTES
This shortcut will close the current workbook.

Explanation about how to close a workbook

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to close a single workbook using Excel, VBA and Shortcut methods.

Excel Methods: This tutorial provides three Excel methods that can be applied to close a workbook. The simplest of the methods is by clicking on the Close button in the upper right corner of a workbook. The other two methods can also accomplished relatively quickly, with only two steps.

VBA Methods: This tutorial provides two VBA methods that can be applied to close a workbook. Using the first VBA method you can close a workbook in which the VBA code is written in. Using the second VBA method you can close a specific workbook by referencing to an open workbook.

Shortcut Method: The Shortcut in this tutorial will instantly close the current workbook.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to open a single workbook using Excel, VBA and Shortcut methods
How to save a workbook using Excel, VBA and Shortcut methods
How to open a single workbook in Protected View using Excel and VBA methods
How to open a single workbook as Read-Only using Excel and VBA methods
How to save and close a workbook using VBA