Wrapping Text

Home/Formatting/ Wrapping Text

Wrapping Text

Macro solution

By Neale Blackwood

The Wrap Text format is often used to reduce the width of a column and still allow the contents to be displayed, as it creates line breaks with a cell.

Excel has an icon in the Home Ribbon in the Alignment Section to Wrap Text.

The macro below puts the Wrap Text format on the cells that are selected prior to the macro being run. It also aligns the text to the top of the cell, which is the most common format people use with Wrap Text.

Sub WrapTextTop()
With Selection
.VerticalAlignment = xlTop
.WrapText = True
End With
End Sub

2017-11-02T15:41:18+00:00 Formatting|