Written by Allen Wyatt (last updated May 18, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Whenever Denise creates a new workbook, Excel always creates it with three worksheets. She seldom (if ever) uses three worksheets in a workbook, so she deletes the extras. This is a bit bothersome to Denise, so she wonders if there is a way to tell Excel that she only wants one or two worksheets when she creates a workbook.
The short answer is yes, there is a way—and it is quite simple. Before explaining how this is done, though, Denise should be commended on making sure that her workbooks contain only the number of worksheets needed for the data contained therein. (It can be a bother to have extraneous, empty worksheets in a workbook!)
In order to adjust the number of worksheets in a new workbook, follow these steps:
Figure 1. The General options of the Excel Options dialog box
That's it; the next time you start Excel (or the next time you create a new workbook from within Excel), it will only include the number of worksheets you specified in step 3.
There is a different, lesser-known method you could use for specifying how many worksheets you want in a new workbook—you could create your own workbook template that has the desired number of worksheets. You could also apply any "default formatting" you want to the workbook and the worksheets. When you then create a workbook based on the template, it will be created using the template as a pattern for the new workbook.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (958) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Need to move quickly through the worksheets in a workbook? Learn the keyboard shortcuts and you can make short work of ...
Discover MoreNeed to create a large number of worksheets using specific names? If so, you'll love the ideas presented in this tip.
Discover MoreExcel provides ways to reference the column or row number of a cell, but it doesn't provide a built-in way to reference a ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-08-25 06:10:32
Graham
I had this problem when I worked for a multi-national company and received sales data from over 20 marketing countries.
Often the files contained the default number of worksheets, usually 3, although only Sheet 1 contained the required data.
Sometimes the extra sheets contained useful data and sometimes they were HIDDEN !!
It was a time consuming task to check all of the extra worksheets manually, so I wrote a macro to do this automatically, see below.
At that time I was only interested in normal cell 'data', so the macro does not check for inserted comments, objects, pictures, etc.
I wrote this macro in the 1990s, so probably Excel 95. It still works for Excel 2010.
Since that time I have always started workbooks with only 1 worksheet, more can be added later if needed.
Sub EmptyWorksheets()
'Works in all situations, including for worksheets that have had data deleted BEFORE workbook is saved.
'Searches all worksheets in the currently active workbook, including HIDDEN worksheets.
'Note a cell is NOT empty if the cell contains a formula, even if the formula result is "".
'However, a cell IS empty if it ONLY has an attached comment, object or picture, etc.
Dim foundsheet, lastcell, countvalue, allcells
For Each foundsheet In Worksheets
lastcell = foundsheet.Cells.SpecialCells(xlLastCell).Address
'lastcell may have an higher value than expected if :-
'An empty cell has an attached comment (The cell is used, but defined as EMPTY by this macro).
'Some data has been deleted, but the workbook has not been SAVED, since
'the xlLastCell value is only reset to a LOWER value when the workbook is saved.
'However the xlLastCell value is automatically INCREASED if data is added to new columns/rows
allcells = "$A$1:" & lastcell
'Defines range of cells that may contain data.
countvalue = Application.WorksheetFunction.CountA(Worksheets(foundsheet.Name).Range(allcells))
'CountA function finds cells that contain data.
If countvalue = 0 Then 'No cells in use
If foundsheet.Visible Then
MsgBox "Worksheet # " & foundsheet.Name & " # is EMPTY"
Else 'sheet is hidden
MsgBox "Worksheet # " & foundsheet.Name & " # is HIDDEN and is EMPTY"
End If
Else 'At least 1 cell contains data
If foundsheet.Visible Then
MsgBox "Worksheet # " & foundsheet.Name & " # CONTAINS DATA"
Else 'sheet is hidden
MsgBox "Worksheet # " & foundsheet.Name & " # is HIDDEN and CONTAINS DATA"
End If
End If
Next foundsheet
End Sub
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments