LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Wrap in merged cells

Folks, Am using the following macro to wrap text in merged cells - unmerges,
wraps, set's height and remerges in essence. For some reason is has stopped
working - any ideas as I am completely stumped!!!! No error messages either.

Thanks / Nick

Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim ActiveCellWidth As Single, PossNewRowHeight As Single
ActiveSheet.Unprotect Password:="ericsson"
Selection.RowHeight = 12.75
If ActiveCell.MergeCells Then
With ActiveCell.MergeArea
If .Rows.Count = 1 And .WrapText = True Then
Application.ScreenUpdating = False
CurrentRowHeight = .RowHeight
ActiveCellWidth = ActiveCell.ColumnWidth
For Each CurrCell In Selection
MergedCellRgWidth = CurrCell.ColumnWidth +
MergedCellRgWidth
Next
.MergeCells = False
.Cells(1).ColumnWidth = MergedCellRgWidth
.EntireRow.AutoFit
PossNewRowHeight = .RowHeight
.Cells(1).ColumnWidth = ActiveCellWidth
.MergeCells = True
.RowHeight = IIf(CurrentRowHeight PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End If
Selection.Locked = False
Selection.FormulaHidden = False
Call ProtectStatusReportWithPassword
End With
End If
 
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
Wrap text in merged cells VBA dme82 Excel Discussion (Misc queries) 2 August 15th 08 09:08 AM
Merged cells/wrap text Daniela Excel Discussion (Misc queries) 1 May 27th 08 09:16 AM
merged cells and wrap text Richard Excel Discussion (Misc queries) 3 July 17th 07 10:22 PM
text wrap in merged cells SteveFerd Excel Discussion (Misc queries) 3 July 16th 05 12:46 PM
text wrap w/ merged cells Dahlman Excel Discussion (Misc queries) 3 April 18th 05 08:37 PM


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