Loading
ExcelRibbon.Tips.Net ExcelTips (Ribbon Interface)

Changing Default Row Height

Loretta wants to set a default row height with word wrap, but she also wants automatic row height to play into it. She doesn't want some "skinny" rows to appear. The default row height in her worksheet seems to be 12.75 but she'd like that to be, perhaps, 25 and then auto-adjust for any rows that need to have more height. She wonders how to make the default work this way.

There are two ways you can specify row height in a worksheet: explicitly or implicitly. You specify an explicit row height by using the tools on the ribbon to specify the exact height you want used for a particular row or rows. When you do so, you are "locking" the row height so that it is always what you specified.

Implicit height is calculated by Excel based on the size of the largest font used in the row. The default font for Excel is 10-point Calibri, so the row height is calculated to be 12.75. There seems to be no rhyme or reason on how this calculation occurs. For instance, if you change from 10-point Calibri to 20-point Calibri, you would expect the row height to double—but it doesn't. Instead, the row height becomes 26.25. If you change the font from Calibri to Arial, but leave it at 20 points, the row height automatically changes to 25.5.

Loretta wants the row height to be 25 and adjust larger, if necessary, and she wants it to be done automatically. There are no settings to do this. If you change the row height for a workbook to 25, explicitly, it won't adjust larger automatically. That means you need to leave the row height set to implicitly adjust (done by choosing AutoFit as the row height) and, somehow, get it to go no lower than 25.

The only way we've been able to determine to do this as Loretta envisions is to change the font and/or font size for the worksheet. As already noted, you could specify a default 20-point Arial font, and your row height would be 25.5—pretty close to Loretta's desire. This is a rather large font, but you could change the size of the font in individual columns (or cells) within a row and not have it affect the row height. This is true as long as at least one cell in the row is formatted to use a 20-point Arial font.

To change the default font used by Excel, follow these steps:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and Excel 2013 display the File tab of the ribbon and then click Options.)
  2. General should be clicked, by default, at the left of the dialog box—unless you are using Excel 2007, in which case Popular should be clicked. (If it isn't for some reason, click it.) (See Figure 1.)
  3. Figure 1. The General options of the Excel Options dialog box.

  4. Use the Use This as the Default Font drop-down list to choose which font you want used.
  5. Use the Font Size drop-down list to choose the size of that font you want used.
  6. Click OK.

Another approach is to adjust a column's font after you create a new workbook. For instance, let's say you open a new workbook, and you know that the data you enter will occupy rows in columns A through M. You could select column N (one column past where you will be working) and change the font for that single column to 20-point Arial. Excel automatically adjusts the row height in all the rows to 20.5 based on the new implicit row-height calculation for column N. There doesn't have to be any data in column N; you just need to adjust the font and/or font size for the column.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (5663) applies to Microsoft Excel 2007, 2010, and 2013.

Related Tips:

Organize Your Data! Using the powerful sorting capabilities of Excel can help you get your data into just the order you need. Find out how you can use the full capabilities of sorting to your benefit. Check out ExcelTips: Serious Sorting today!

 

Comments for this tip:

Alice    24 Jul 2013, 10:47
C Jenkins quick workaround fixed it for me! Thank you! This has been bugging me for awhile. Brilliant fix!
LCable    16 Jul 2013, 12:01
That worked! Thanks!
Willy Vanhaelen    16 Jul 2013, 11:55
Do the following to be sure you copy the macro in the right place:
- Activate the sheet you want the macro to work in.
- Click the 'Developer' tab in the ribbon.
- Click 'View Code' in 'Controls'.
- That's the place were you can copy the macro.
- Be sure NOT to change the macro's name.

The macro will only be triggered when the cell's content is changed. Simply changing the font size for example will not trigger it unless you afterwards press F2 and Enter.

Willy
LCable    15 Jul 2013, 14:28
I tried Willy's macro and couldn't get it to work properly when I thought it would adjust the line height to higher than 25. I put his macro into a new macro saved in the worksheet I was using. Wasn't sure about his direction to put it in the VBA project.
Aldo    09 Jul 2013, 17:03
Don ... if your organization creates Certificates for each person required, then you can use those to maintain security and still be able to create and use custom macros.

Have your IT people look into it. The certificate writer is included in MS Office.
Don    08 Jul 2013, 14:11
Willy...Thanks for the macro. I've got a slightly different use for it, resetting row height when there are merged cells.

There is one problem with macros (and I use a lot of them): Sometimes organizations place security restrictions on and lock that on people's PCs.
C Jenkins    08 Jul 2013, 01:30
Another solution is select one column, change the font to give you the desired row height.

Now hide the column from view.

Setup the selected columns with text wrap, ensure the text in these columns is set vertically in the centre.
Willy Vanhaelen    06 Jul 2013, 11:06
Here is a solution to do this autmatically.

Set the row height explicitly to 25 for the entire worksheet or the range you want as explained in the second paragraph above.

Place this little macro in the corresponding sheet in the VBA project (not in a module!). When entering data it will adjust the row height automatically to larger when necessary or keep it / restore it to 25 otherwise:

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Rows.AutoFit
If Target.Rows.RowHeight < 25 Then Target.Rows.RowHeight = 25
End Sub

Willy Vanhaelen

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 3+4? (To prevent automated submissions and spam.)
 
          Commenting Terms
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2013)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2013)

Our Products

Premium Newsletters

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2014 Sharon Parq Associates, Inc.