Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Wrapping Text in a Merged Cell

I can not get the Text Wrapping feature to work in a merged cell. Can this be
done?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Wrapping Text in a Merged Cell

Text wrapping in a merged cell should work ok.

But you may need to adjust the rowheight manually to see everything you want.

And if the text just seems to fade away after a few lines of really long text,
you can add alt-enters (to force a newline within the cell) every 80-100
characters to see more.

jeh1121 wrote:

I can not get the Text Wrapping feature to work in a merged cell. Can this be
done?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Wrapping Text in a Merged Cell

Text-wrap works fine in a merged cell.

What won't work is Autofit to expand the wrapped text.

The only way around it is to...............

1. DON'T USE merged cells. They cause no end of problems with copying,
pasting, sorting, filtering and, as you have found, with autofit.

2. Use event code from Greg Wilson

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the code into that sheet module.


Gord Dibben MS Excel MVP




On Mon, 25 Feb 2008 10:46:04 -0800, jeh1121
wrote:

I can not get the Text Wrapping feature to work in a merged cell. Can this be
done?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Wrapping in a Cell SiH23 Excel Discussion (Misc queries) 1 October 9th 07 05:47 PM
Wrapping text in merged cells Taza Excel Discussion (Misc queries) 3 January 16th 07 08:56 AM
Text not wrapping within a cell Frank D. Nicodem, Jr. Excel Discussion (Misc queries) 1 June 29th 06 04:17 PM
Wrapping text in a cell Andrew Chalk Excel Discussion (Misc queries) 4 October 15th 05 04:04 AM
How can I Excel to re-size when wrapping text in merged cells Samjoy Excel Discussion (Misc queries) 4 February 4th 05 12:47 AM


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"