--
Jim Rech
Excel MVP
"kchambers" <kcha...@discussions.microsoft.com> wrote in message
news:B18253BC-C422-417C...@microsoft.com...
Maybe you could copy/paste the problem merged cell into a new workbook and
send it to me, once you verify that the problem reproduces in it of course..
--
Jim Rech
Excel MVP
"kchambers" <kcha...@discussions.microsoft.com> wrote in message
news:2CB664C0-90C6-47B0...@microsoft.com...
Sub AutoFitMergedCellRowHeight()
Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim ActiveCellWidth As Single, PossNewRowHeight As Single
If ActiveCell.MergeCells Then
With ActiveCell.MergeArea
If .Rows.Count = 1 And .Cells(1).WrapText = True Then
''<<.Cells(1) added
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
End With
End If
End Sub
--
Jim Rech
Excel MVP
"Jim Rech" <jrr...@hotmail.com> wrote in message
news:Oqghj%23PIF...@TK2MSFTNGP14.phx.gbl...