Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Wrap Text doesn't work in Merged Cell

Excel 2003 I have a form set up that limits access to only unlocked cells
when protection is on. Some of the cells are merged in a row, and are
intended to hold text (sentences) that might vary in length, so I checked the
Wrap Text box. I also set the Row Height to AutoFit. However the row height
does not expand to show a long text entry, either when the spreadsheet is
protected, or even when unprotected and I double-click the lower cell
boundary in the row header.

Am I missing something or isn't this really a capability? Would I have to
set up a macro to do this, either automatically on exit from the cell or by
the click of a button?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Wrap Text doesn't work in Merged Cell

Wrap Text works in a merged cell but Autofit does not.

You need VBA event code to make it work.

Here is code from Greg Wilson.

Make sure Wrap Text is enabled for all cells in question.

I also threw in some sheet unprotect and protect lines

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
Me.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
Me.Protect Password:="justme"
End Sub


Gord Dibben MS Excel MVP



On Wed, 29 Jul 2009 12:26:02 -0700, Steve
wrote:

Excel 2003 I have a form set up that limits access to only unlocked cells
when protection is on. Some of the cells are merged in a row, and are
intended to hold text (sentences) that might vary in length, so I checked the
Wrap Text box. I also set the Row Height to AutoFit. However the row height
does not expand to show a long text entry, either when the spreadsheet is
protected, or even when unprotected and I double-click the lower cell
boundary in the row header.

Am I missing something or isn't this really a capability? Would I have to
set up a macro to do this, either automatically on exit from the cell or by
the click of a button?


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
How do I get date/time to wrap (format - wrap text doesn't work)? Alex Excel Discussion (Misc queries) 3 April 4th 23 02:29 PM
Merged cell text does not wrap Jessica Excel Discussion (Misc queries) 1 December 5th 07 03:00 AM
How to control row height and text wrap in non-merged cell ??? akm Excel Discussion (Misc queries) 2 November 16th 07 02:01 AM
Getting word wrap to work in a merged cell Dave Couch Excel Discussion (Misc queries) 1 October 31st 07 11:17 PM
How do I view all text in a merged cell? Wrap text is activated. susjorg Excel Discussion (Misc queries) 1 January 23rd 07 07:34 PM


All times are GMT +1. The time now is 11:39 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"