TL;DR —
WrapText = Truetells Excel to break long text onto several lines within the column width instead of spilling across the next cell. It reshapes the cell — but it only makes the row taller if the row height is still on auto. If a macro (or a merged cell) has pinned an explicitRowHeight, the text wraps invisibly and stays clipped. To actually see wrapped text, do the three-step dance: set a fixed column width, turnWrapTexton, then callRows.AutoFitso the row grows to the new shape.
' Wrapping reshapes the cell; row height must be free to grow to show it.
Columns("C").ColumnWidth = 40 ' 1) give the text a fixed width to wrap against
Range("C2:C100").WrapText = True ' 2) break long text onto multiple lines
Range("C2:C100").EntireRow.AutoFit ' 3) let the rows grow to fit the wrapped text
' Turn it back off:
Range("C2:C100").WrapText = False
WrapText is the code twin of the Wrap Text button on the Home ribbon. Without it, a long label
just runs off to the right, hidden the moment the neighbor cell has anything in it. With it, the same
label folds onto two or three lines and stays inside its column. That much is obvious from the button.
What the button hides — and what trips up every macro that tries to automate it — is that wrapping is
tangled up with row height, and getting readable output means treating the two together.
What you'll learn
- The mental model —
WrapTextreshapes the cell; it does not change the text - The one rule that matters — wrapping only grows the row when the height is on auto
- The three-step sequence that makes wrapped text actually show (width, wrap, AutoFit)
WrapTextversus a hard line break (Chr(10)/ Alt+Enter)- Reading
WrapTextback, and why a mixed range returnsNull - Which columns to wrap and which to leave alone
The mental model: reshaping the cell, not editing the text
Turning wrapping on does not touch the value in the cell. "North America regional summary" is the
same string before and after; what changes is how Excel lays it out. Off, the string is drawn on one
line that overflows to the right until a neighbor blocks it. On, Excel folds it into lines that each fit
the column width, stacking downward. Think of WrapText as changing the shape of the box the text
lives in — narrower and taller — not the text itself.
That shape change is the whole point, and it explains the one thing beginners miss: a wider box needs a taller row to show all the lines. Wrapping and row height are two halves of the same idea. You cannot change one and ignore the other and expect the result to look right.
The rule that matters most: wrap grows the row only if the height is free
Here is the mistake behind almost every "I set WrapText but nothing wraps" report. WrapText = True
folds the text internally, but the row only gets taller to reveal those extra lines if the row height
is on auto. If anything has already fixed the height, Excel keeps that height and clips the wrapped
lines out of sight:
Rows(2).RowHeight = 15 ' a macro pinned the height earlier...
Range("C2").WrapText = True ' text wraps internally, but the row stays 15pt - clipped
Two things commonly pin the height: a macro that set RowHeight to a number, and — the sneaky one —
a merged cell, because Rows.AutoFit refuses to resize a row that contains one (see
AutoFit). The fix is to leave the height on auto and let AutoFit measure it, or, if
you truly need merged cells, calculate and set the RowHeight yourself. The rule to remember:
WrapText = True reshapes the cell, but something still has to make the row tall enough to show it.
The three-step sequence that actually works
Because wrapping and height are linked, getting readable output is an ordered, three-step move — and order matters:
Columns("C").ColumnWidth = 40 ' 1) a FIXED width - the text needs something to wrap against
Range("C2:C100").WrapText = True ' 2) turn wrapping on
Range("C2:C100").EntireRow.AutoFit ' 3) grow the rows to the new wrapped shape
Step one is the part people skip. Row AutoFit can only compute a height once the column width is
settled — the text has to know how wide it is allowed to be before it can decide how many lines it
needs. If you AutoFit the column width and the row height, the two fight: widening the column lets the
text fit on fewer lines, which changes the height, and you get an unstable result. So fix the width
first (do not AutoFit it), then wrap, then AutoFit the height. Do the three in that order and the output
is right every time.
WrapText versus a hard line break
There are two different ways text ends up on multiple lines, and mixing them up causes confusion.
WrapText is a soft, width-driven wrap: Excel decides where to break based on the column width, and
the breaks move if you resize the column. A hard line break is a character you put in the string
yourself — Chr(10) in VBA, or Alt+Enter by hand — which forces a break at that exact spot regardless
of width:
Range("C2").Value = "Line one" & Chr(10) & "Line two" ' a hard break inside the text
Range("C2").WrapText = True ' needed for the hard break to SHOW
The catch: even a hard Chr(10) break only displays as two lines when WrapText is on — otherwise
Excel shows a little box glyph or runs it together. So the two work together: use Chr(10) when you
want a break at a specific place (an address block, a label over a value), and rely on plain WrapText
when you just want long prose to fold to fit.
Reading WrapText back, and the mixed-range Null
WrapText is a per-cell property. Read it on a single cell and you get True or False. Read it on a
range where some cells wrap and some do not, and Excel cannot give one answer, so it returns Null:
Debug.Print Range("C2").WrapText ' True or False
Debug.Print Range("C2:C100").WrapText ' Null if the range is mixed
That Null is not an error — it is Excel telling you the range is inconsistent. If you need to test
whether a range is uniformly wrapped, check IsNull(rng.WrapText) first; a non-Null result means
every cell agrees. In practice you rarely read it back — you set it on a whole column at once, which
keeps the range uniform and sidesteps the question entirely.
Which columns to wrap
Wrapping earns its place on text columns — descriptions, comments, addresses, long labels — where
folding keeps the column narrow and the sheet readable. It is usually wrong on number columns: a
wrapped number is harder to read, not easier, and numbers rarely need it. The efficient habit is to set
WrapText on the whole column in one statement (Columns("C").WrapText = True) rather than looping
cell by cell, then AutoFit the rows once for the whole block. Setting it per cell in a loop is both
slower and a common source of the mixed-range Null above. Decide per column, apply once, AutoFit once.
How ExcelMaster helps
Wrap Text is the setting that looks like a one-liner and then produces clipped output nobody notices
until the report is printed — the row height was pinned earlier, the column width was never fixed so
AutoFit measured the wrong shape, or the hard Chr(10) break never shows because wrapping was left off.
ExcelMaster lets you describe the
result — "wrap the description column and let the rows grow," "put the address on three lines in this
cell" — and it writes the steps in the right order: a fixed column width first, WrapText on the whole
column, then Rows.AutoFit, with Chr(10) where you asked for a hard break and wrapping turned on so
it shows. It flags merged cells that will block the row from growing. You keep the workbook and the
code.
Frequently asked questions
Why is my VBA WrapText not working?
The text is almost certainly wrapping — it just is not showing, because the row height is fixed. Row
height only grows to reveal wrapped lines when it is on auto. Leave the height alone and call
Rows.AutoFit after setting WrapText = True, and make sure the column has a fixed width first so the
text has something to wrap against. If the cell is merged, row AutoFit will not resize it at all — set
the RowHeight explicitly.
How do I wrap text and AutoFit the row height in VBA?
Do three steps in order: set a fixed column width (Columns("C").ColumnWidth = 40), turn wrapping on
(Range("C2:C100").WrapText = True), then AutoFit the rows (Range("C2:C100").EntireRow.AutoFit).
Fixing the width first matters — row AutoFit can only measure the needed height once the text knows how
wide it is allowed to be.
How do I turn Wrap Text off in VBA?
Set the property to False: Range("C2:C100").WrapText = False. If the rows were grown to fit the
wrapped text, they will not shrink back on their own — call Rows.AutoFit again afterward, or set an
explicit RowHeight, to return them to a single-line height.
What is the difference between WrapText and a Chr(10) line break?
WrapText is a soft, width-driven wrap — Excel chooses where to break based on the column width, and
the breaks move when you resize. Chr(10) (the same as Alt+Enter) is a hard break you place inside the
string at an exact spot. A hard break only displays as multiple lines when WrapText is also on, so
the two are usually used together.
Why does Range.WrapText return Null?
Because WrapText is a per-cell property and the range is mixed — some cells wrap and some do not, so
Excel cannot return a single True or False and gives Null instead. Read it on a single cell for a
definite answer, or test IsNull(rng.WrapText) to check whether a whole range is uniform. Setting
WrapText on the whole column at once keeps it consistent.
Tested in
Tested in: Excel 365 (Windows 11), VBA 7.1 — last verified 2026-09-10.
Related guides: VBA AutoFit · VBA Freeze Panes · VBA Column Width · VBA Merge Cells · VBA Font
