How to Close Excel Using the Keyboard on Windows PC

How-to basics · Updated November 20, 2026

To close Excel on a Windows PC, press Alt+F4 while the Excel window is active. If the workbook has unsaved changes, choose whether to save them before Excel closes. This guide explains the difference between quitting Excel and closing just one workbook, and what to do if a save prompt or another window appears.

What You’ll Need

  • A Windows PC with Excel open and its window active. The main instructions are for Excel for Microsoft 365 on Windows.
  • If you want to keep your latest changes, be ready to save the workbook. You can save first with Ctrl+S.

Step-by-Step

  1. Make sure Excel is the active window. Click the Excel window, or switch to it with Alt+Tab until it is selected. The shortcut in the next step acts on whichever window is active. If another program, a file dialog, or a browser is selected, that window may close instead.
  2. Press Alt+F4 once. Hold down Alt, tap F4, then release both keys. This is the standard Windows shortcut for closing the active window. When Excel is the active window, it asks Excel to close. If this is your last open Excel window, the Excel application exits; if you have other Excel windows open, those can remain.
  3. Check whether Excel asks you to save. If you changed the workbook since the last save, Excel normally displays a prompt with choices such as Save, Don’t Save, and Cancel. The precise wording or layout can differ depending on the file and Excel version. Do not assume that pressing the shortcut automatically saves your work.
  4. Choose what should happen to your changes. To keep them, select Save. If you do not want the changes, select Don’t Save. Choose Cancel if you are not ready to close and want to return to the workbook. You can use the arrow keys or Tab to move between available controls, then press Enter to activate the selected option. Read the prompt before confirming, especially if you are unsure which workbook is being closed.
  5. Wait for Excel to finish saving or closing. A large workbook, a slow connection, or a cloud location can take a moment. If Excel displays a progress indicator or a message that it is saving, wait rather than pressing Alt+F4 repeatedly. When the save completes, Excel should close the window or return you to another open Excel window.
  6. Confirm the result. If the Excel window disappears and you see the desktop or another application, you have closed that window. If another workbook window appears, Excel is still open with that workbook. Repeat the shortcut only if you intend to close the other window too. If you only meant to close one workbook while leaving Excel available, use the workbook-closing option described below instead.

To close a workbook but not necessarily quit Excel: press Ctrl+W while the workbook is active, then respond to any save prompt. This closes the current workbook window; Excel may remain open, show another workbook, or display its start screen. Alt+F4 is the better choice when your goal is to close the active Excel window and, when it is the last one, exit Excel.

Common Mistakes

  • Using Ctrl+W when you meant to quit Excel. This usually closes the active workbook, not every open Excel window. If you still see another workbook or the Excel start screen, the application has not necessarily exited. Use Alt+F4 on the active Excel window when you want to close it.
  • Pressing Alt+F4 while another app is selected. The shortcut closes the active window, not a specific program by name. Check the selected window first, especially if you have switched among Excel, a browser, and other apps.
  • Choosing Don’t Save without checking what changed. That choice discards edits made since the last save. If you are uncertain, choose Cancel, return to the workbook, and save a copy or inspect the file before closing.
  • Pressing the shortcut repeatedly when a prompt appears. A save confirmation is a separate dialog that needs a decision. Repeating shortcuts can act on that dialog or another window, so read the options and select one deliberately.
  • Assuming AutoSave means every edit is already safely stored. AutoSave can be available for eligible files stored in OneDrive or SharePoint, but status and syncing can vary. Check for saving or sync messages and use Ctrl+S if you want to request a save before exiting.
  • Expecting a laptop’s F4 key to work by itself. Some keyboards use the function row for brightness, volume, or other hardware actions. You still need Alt+F4; on some keyboards, you may also need to hold Fn to send the F4 key signal.

Tips

  • Save before closing when the edits matter. Press Ctrl+S, wait for the save to finish, and then press Alt+F4. This gives you a chance to notice a save error before closing. For a new workbook that has never been saved, Excel may open a Save As dialog so you can choose a name and location.
  • Use the shortcut that matches your goal. Think of Ctrl+W as closing the current workbook and Alt+F4 as closing the active window. The distinction matters when several workbooks are open or when you want Excel to remain available.
  • Keep other open workbooks in mind. Excel can have more than one workbook window. Closing one does not automatically mean every workbook has closed. Check the taskbar or switch windows with Alt+Tab before assuming you have exited the application.
  • On a Mac, use the Mac app shortcut. In Excel for Mac, press Command+Q to quit Excel. Use Command+W to close the current workbook or window while leaving the application available where applicable. Windows Alt+F4 is not the Mac quit shortcut.
  • In Excel for the web, distinguish Excel from the browser. Excel for the web runs inside a browser tab. Browser shortcuts such as Ctrl+W generally close the tab, not just the workbook, and Alt+F4 may close the browser window. Use the browser’s tab controls when you mean to close the page, and check that the workbook has finished saving first.

Troubleshooting

  • Nothing happens when you press Alt+F4. First check that Excel has focus by switching to it with Alt+Tab. On a compact keyboard, try Alt+Fn+F4 if the F4 key has a secondary function. If a menu or dialog is open, it may need to be dismissed or handled before the workbook window responds.
  • The screen changes, but Excel does not seem to close. You may have closed one workbook while another is still open, or the Excel start screen may still be displayed. Look for Excel on the taskbar and switch back to check. To quit, make the Excel window active and press Alt+F4 again, responding to any prompts.
  • You see a save prompt and do not know what to choose. Select Cancel to return to the workbook without closing it. Then use Ctrl+S or open File > Save As if you need to choose a new location or name. Once you have confirmed the correct file is saved, close it again. Choose Don’t Save only when you are certain you want to discard the unsaved changes.
  • Excel appears frozen or will not respond. Wait briefly in case it is calculating, saving, or loading a large workbook. If it becomes responsive, save your work and close normally. If Windows reports that Excel is not responding and it will not recover, you may need to close it through Windows Task Manager, but unsaved changes can be lost. After reopening Excel, check for a Document Recovery pane or recovered files; recovery is not guaranteed, so save regularly.
  • A browser closes instead of an Excel desktop app. You may be using Excel for the web. In that case, Alt+F4 applies to the browser window, while Ctrl+W usually closes the browser tab. Confirm the workbook’s save status before closing the tab, and reopen it from its OneDrive or SharePoint location if needed.

Frequently Asked Questions

What is the keyboard shortcut to close Excel on Windows?
With the Excel window active, press Alt+F4. Save or discard any unsaved changes when prompted.

Does Ctrl+W quit Excel?
It generally closes the active workbook, not necessarily the Excel application. Other open workbooks or the Excel start screen may remain.

Will closing Excel automatically save my workbook?
No. If there are unsaved changes, Excel normally asks what you want to do. Choose Save to keep them, or save with Ctrl+S before closing.

How do I close Excel without a mouse?
Press Alt+F4, use Tab or the arrow keys to move to the desired save-prompt option, and press Enter. If you want to leave Excel open and close only the workbook, use Ctrl+W.

What is the shortcut to quit Excel on a Mac?
Press Command+Q to quit Excel for Mac. Command+W closes the active workbook window instead of quitting the app.

Can I use these shortcuts in Excel for the web?
Be careful: the web version runs in a browser, so shortcuts such as Ctrl+W may close the tab. Check that the workbook has saved, then close the browser tab using its usual controls.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.