Wrap text only when selected

L

Lee

Tricky question here . . . I have many text cells that I would prefer
to have formatted with no text wrapping. That makes scanning the
sheet for other data much easier on the eyes (fixed row height).
However, I do need to see what the text is, but only on a line-by-line
basis.

I know that if I double-click on a cell, it will expand the text out.
But what I'd really like to do is highlight the row (or a few rows)
and have that apply text wrapping to each text cell in the region, and
only for as long as it is highlighted.

Can this even be done?

Thanks,
Lee
 
D

Debra Dalgleish

It might become annoying, but the following code will wrap text in the
selection:

'==========================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.WrapText = False
Target.WrapText = True
End Sub
'=============================

To add the code to your workbook, right-click on the sheet tab, and
choose View Code. Paste the code in the code module, where the cursor is
flashing.
 
L

Lee

Thank you very much!

Lee

Debra Dalgleish said:
It might become annoying, but the following code will wrap text in the
selection:

'==========================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.WrapText = False
Target.WrapText = True
End Sub
'=============================

To add the code to your workbook, right-click on the sheet tab, and
choose View Code. Paste the code in the code module, where the cursor is
flashing.
 
Top