Preventing Changes to Multiple Selected Worksheets

Written by Allen Wyatt (last updated April 16, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


4

In Lance's office they often have to select multiple worksheets in a workbook in order to print them or to create PDFs. When done, the worksheets remain selected. This causes a potential problem if someone forgets to deselect the worksheet group. If someone makes a change in a cell, the change occurs on all the other selected worksheets, as well; this is how Excel is designed. Lance wonders if there is a way to either stop the change being made on multiple worksheets or automatically have the multiple worksheets deselected after they are done with an action.

When you forget to deselect a group of worksheets, it can be frustrating that what you intended as a single-worksheet change ends up on all the worksheets. As Lance notes, this behavior is actually built into Excel; it is by design.

Perhaps the easiest solution is to simply change how you print your worksheets. You could select all the worksheets you want to print, and then do the actual printing by using a simple macro:

Sub PrintSelectedSheets()
    ActiveWindow.SelectedSheets.PrintOut
    ActiveSheet.Select
End Sub

The macro prints and, once that is done, deselects the group of worksheets so that only a single worksheet (the active one) is selected. The only downside to this approach is remembering to print via the macro, so it will take a bit of training for users.

This won't, of course, help you in situations where you selected a group of worksheets for some purpose other than printing. In those instances, you are left with remembering to deselect the group. (Or, if you can handle the action via macro, you could adapt the above to work for you.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7708) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Randomly Resetting Numbering

Have you ever been frustrated by the automatic numbering feature in Word? You are not alone. Fortunately, there are a few ...

Discover More

Finding the Address of the Lowest Value in a Range

Uncovering the lowest value in a range is relatively easy; you can just use the MIN worksheet function. Discovering the ...

Discover More

Inserting a Dynamic Word Count in Your Document

Need to know how many words are in your document? You can use the NumWords field to add that statistic, dynamically, to ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Printing a Number of Different Pages

If you don't need to print an entire workbook, it can be confusing to figure out how to print just certain pages. This ...

Discover More

Repeating Rows on a Printout Except On the Last Page

When setting up a worksheet for printing, you can specify that Excel repeat some of your rows at the top of each page ...

Discover More

Changing Paper Size for a Complete Workbook

If you need to change the size of paper on which your worksheets will be printed, it can be bothersome to make the change ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 9 + 2?

2024-04-16 08:20:42

Alan Cannon

A different approach would be to use a BeforeSave event handler macro stored in the ThisWorkbook module. This would prevent the situation even if the selected sheets weren't being printed. I chose BeforeSave instead of BeforeClose because the workbook would still be saved with the multisheet selection if the BeforeClose event were used. Here's my suggestion.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If ActiveWindow.SelectedSheets.Count > 1 Then
ActiveSheet.Select
End If
End Sub


2020-08-24 22:14:05

John Mann

Why not have a macro triggered by the print event which does the select active worksheet?


2020-08-24 09:58:59

Harlan Eshleman

Here is a page that gives a macro that will warn you if you are trying to make edits when multiple sheets are selected. I think that it would allow you to print, since that shouldn't invoke the worksheet change event.
https://www.extendoffice.com/documents/excel/4166-excel-prevent-multiple-sheet-selection.html


2020-08-22 06:59:01

Elliot Penna

"The only downside to this approach is remembering to print via the macro, so it will take a bit of training for users."

Couldn't you disable print on opening the workbook, and enable it within the printing macro, print, and then disable printing again before exiting macro? That would, in effect, force people to use the macro to print. After all, if you are putting your trust in training, why not train everyone to select a single sheet on opening?

Better yet, why not have a macro on opening, or on closing, select a single sheet?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.