Written by Allen Wyatt (last updated April 1, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Gary has a workbook set up with twelve worksheets, one for every month. He has framed the information in these worksheets so it just fits on his screen. At some point he opens his workbook to find that the June column widths have expanded so that they don't all fit on his screen. It is only the June columns that expand, but all worksheets will have their row heights expand from 12.75 to 13.50. If Gary resizes everything back so it once more fits his screen, everything is fine for a week or so, and then the resizing happens again.
It is unclear what might be causing this problem, but there are a few things you can check. If the workbook is stored on a network, where it can be accessed by other people, it could be that the change is occurring while someone else has the workbook open. In addition, if the workbook is opened on different machines, it could be that the other machines on which it is opened may be affecting the workbook, provided they have different screen resolutions or different printer fonts installed.
Being unsure as to the cause, it may be that the best solution is to create a macro that runs automatically when the workbook opens. This macro could go through the worksheets and set the column widths and row heights to what you need The following macro will perform these steps:
Private Sub Workbook_Open() Dim wSheet As Worksheet For Each wSheet In Worksheets ' Change range to reflect columns and rows you need to affect With wSheet.Range("A1:A15") .ColumnWidth = 12 ' Change to column width desired .RowHeight = 13 ' Change to row height desired End With Next wSheet End Sub
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8774) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Random Width and Height Changes.
Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!
Got just a small amount of worksheet data to print out? It might look better on the printed page if you center it. Excel ...
Discover MoreDo you want to copy formats from one worksheet to another? You can do so easily by using the Format Painter. It even ...
Discover MoreExcel does not provide a built-in way to change the background color used in a worksheet. You can, however, try a few ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2025-04-03 13:06:50
Sandeep
@Jamies Looks interesting. Pl share code.
2025-04-01 09:19:13
Barry
@Jamies
Sounds interesting! Any chance of sharing some details, please?
2025-04-01 05:50:11
jamies
Been there -
better option -
a script that goes through the columns and rows of a worksheet, and records the sizes - with "Wrap" status too
and that gets saved to a worksheet, or a comma separated text file as a set of values
and - the more sophisticated version -
aggregates the individual rows/column entries into ranges -
Using the R1C1 mode of cell addresses in the scripts makes things easier too!
Goes back to basic techniques for database setup -
scripts to create the tables, load data, and set dependencies (data validation and lookups) views of the data (pivot tables).
Also creates a means for an easy and swift way for test versions of the facilities to be created, and for the main system to be recreated on a new database store.
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 © 2025 Sharon Parq Associates, Inc.
Comments