Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Wrapping Text in Merged Cells - Excel 2002
I have merged cells which have condiational formatting applies, the wrap text
is checked and the text will not wrap. I have tried a few of the macros which were mentioned in other questions with no success. Anyone have any suggestions. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Wrapping Text in Merged Cells - Excel 2002
Wrap text text works fine in merged cells.
However.............autofitting of row height does not work. See google search thread for code by Greg Wilson. Watch out for word wrap in the URL which is all one line. http://groups.google.com/group/micro...1c160cbeb27874 If this code is one of the macros you tried, please post back and explain what is or is not happening. Gord Dibben MS Excel MVP On Thu, 30 Apr 2009 11:34:25 -0700, Cornelia wrote: I have merged cells which have condiational formatting applies, the wrap text is checked and the text will not wrap. I have tried a few of the macros which were mentioned in other questions with no success. Anyone have any suggestions. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Wrapping Text in Merged Cells - Excel 2002
Hi Gord,
I cut and pasted the macro below and I am getting a error on the ---- ma.MergeCells = False ---- line, any suggestions? 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 "Gord Dibben" wrote: Wrap text text works fine in merged cells. However.............autofitting of row height does not work. See google search thread for code by Greg Wilson. Watch out for word wrap in the URL which is all one line. http://groups.google.com/group/micro...1c160cbeb27874 If this code is one of the macros you tried, please post back and explain what is or is not happening. Gord Dibben MS Excel MVP On Thu, 30 Apr 2009 11:34:25 -0700, Cornelia wrote: I have merged cells which have condiational formatting applies, the wrap text is checked and the text will not wrap. I have tried a few of the macros which were mentioned in other questions with no success. Anyone have any suggestions. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Wrapping Text in Merged Cells - Excel 2002
I would guess the sheet is protected.
Try this version. 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 On Error GoTo endit ActiveSheet.Unprotect Password:="justme" 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 endit: ActiveSheet.Protect Password:="justme" End Sub Gord On Mon, 11 May 2009 10:15:02 -0700, Cornelia wrote: Hi Gord, I cut and pasted the macro below and I am getting a error on the ---- ma.MergeCells = False ---- line, any suggestions? 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 "Gord Dibben" wrote: Wrap text text works fine in merged cells. However.............autofitting of row height does not work. See google search thread for code by Greg Wilson. Watch out for word wrap in the URL which is all one line. http://groups.google.com/group/micro...1c160cbeb27874 If this code is one of the macros you tried, please post back and explain what is or is not happening. Gord Dibben MS Excel MVP On Thu, 30 Apr 2009 11:34:25 -0700, Cornelia wrote: I have merged cells which have condiational formatting applies, the wrap text is checked and the text will not wrap. I have tried a few of the macros which were mentioned in other questions with no success. Anyone have any suggestions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Wrapping Text in Merged Cells - Excel 2002 | Excel Discussion (Misc queries) | |||
wrapping text in merged cells | Excel Discussion (Misc queries) | |||
Wrapping text in merged cells | Excel Discussion (Misc queries) | |||
wrapping of very long text in EXCEL 2002 cells | Excel Discussion (Misc queries) | |||
How can I Excel to re-size when wrapping text in merged cells | Excel Discussion (Misc queries) |