6

Let's say we have a spreadsheet with all rows having the same default height.

In a cell, let's write Hello ALT+ENTER World. I indeed sometimes need to enter multi-line text in a cell, to write some long notes, etc.

Then this cell will automatically have the Wrap text button enabled (in the Home Ribbon menu), and this specific row will automatically have its height increased.

How to disable this automatic Wrap text? without having to manually click on Wrap text again to disable it?


See also (linked questions without a perfect solution for this problem):

Basj
  • 1,489
  • 7
  • 47
  • 90
  • I believe if you type , then Excel assumes you want to wrap text in the cell since you are specifying more than one line of text in it. You could always write a macro with a Worksheet Change for format the cell you just typed in as you want it to be. – cybernetic.nomad Nov 25 '21 at 19:38
  • I reviewed a [late answer](https://superuser.com/a/1766268/) that should be upvoted and accepted for future visitors. – Blind Spots Feb 03 '23 at 19:21

4 Answers4

2

Set Fixed Row Height(s)


In order to stop row heights from increasing to accommodate content containing ALTENTER line breaks you can set the row height(s) to a fixed value.

Row Height: Fixed Value  vs.  Default

Instructions


  1. Select the row(s) whose height you want to lock
  2. Open the Row Height dialog using one of the following approaches:  See images that follow
     A.  Ribbon Bar:  Select Home > Format > Row Height   
     B.  Mouse:  Right-click row(s) > left-click Row Height   
     C.  Keyboard:  ALT+H then OH
  3. Choose OK to accept the prepopulated row height or set a numeric value of your choice then click "OK"  * See NOTES Below

Notes


ROW HEIGHT Dialog Box   ( Instructions: Step 3 )

  • With a single row selected, the Row Height dialog box will always have the Row height field prepopulated with the row's current height.
  • With multiple rows selected, the field will be prepopulated only if all have identical heights.
  • Any time the field is prepopulated, one can immediately select OK (editing the field value becomes [optional]).
  • In the case where the heights of multiple rows do not match, the Row height field will be empty. In that case a value must be entered before choosing OK. Otherwise, it will be equivalent to choosing CANCEL.

 

Ribbon Bar Approach


Home > Format > Row Height

Right-Click Approach


Right-Click row(s)

Keyboard Approach


ALT+H

then O

then H

Blind Spots
  • 2,607
  • 1
  • 16
  • 21
0

Could you please tell us which verion of Office are you using?

If you have one of Professioanl Plus versions, you could try the Group Policy to disable this shortcut.

User Configuration > Administrative Templates > Microsoft Excel 2016 > Disable Items in User Interface > Custom, enable "Disable shotcut keys". Then enter following "[key],[modifier]" values:13,16.

enter image description here

For more information, please refer to "Use Group Policy to disable user interface items and shortcut keys in Office 2013".

Emily
  • 3,339
  • 1
  • 4
  • 6
  • I still use 2007, and I don't see any Excel-related thing in `Group Policy` but it might be possible (I found some links about this) to add Group Policy for 2007, I'll try. – Basj Nov 26 '21 at 08:29
  • Anyway, what does your technique do? What does it disable exactly? If it disables the ALT+ENTER shortcut, then it's not what I'm looking for. I still want to be able to do ALT+ENTER to have multiline text. But I just want to avoid the automatic enabling of `Wrap text` button, and automatic change of height of a row. – Basj Nov 26 '21 at 08:30
0
  1. Ctrl + A to select all cells in the current worksheet
  2. Right click on any row number > Row Height > OK
  3. Right click on any row number > Format Cells > Vertical Alignment = Top > OK
  • 1
    This doesn't work. As soon as you edit one of the cells with line breaks and hit enter they revert to the text wrapping. – Toivo Säwén Dec 13 '22 at 15:45
  • @ToivoSäwén you are correct. The [answer](https://superuser.com/a/1757084/) only works if all rows in the worksheet share identical heights. If even one row is different, the solution fails. This [answer by user1769377](https://superuser.com/a/1766268/1007040) works properly and should be upvoted to help future visitors to this question. – Blind Spots Feb 03 '23 at 19:18
-1

Maybe an answer:

The "Format Cells" dialog, i.e. CTRL+1 has an Alignment tab, where you find [x] Wrap Text...

To set or Reset that option for the entire sheet; CTRL+A, CTRL+1 and remove/set [x] Wrap Text

This might help...

I can imagine that you have Wrap Text enabled for any adjacent cell when the "problem" occurs.

Hannu
  • 8,740
  • 3
  • 21
  • 39
  • Sadly no, it doesn't work. You can try and set all cells (CTRL A) to "Wrap text" unchecked. Then go in any cell. Write `Hello World`, and you'll see the "Wrap text" will come again, automatically, for this cell. – Basj Nov 25 '21 at 17:45