Wrap text only when selected

  • Thread starter Thread starter Lee
  • Start date Start date
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
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top