My rule of thumb is to use the ThisWorkbook module only for
Workbook-level event macros, and worksheet modules only for
worksheet-level event macros. Everything else goes in regular code
modules (Insert/Module in the VBE). This is a very common convention.
You may want to look at
http://www.mcgimpsey.com/excel/modules.html
and
http://cpearson.com/excel/codemods.htm
It's not so much that MS *can't* do the autofit as it is that changing
the behavior risks breaking thousands of existing apps.
You might consider a worksheet-level event macro something like:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target.Cells, Range("A1,B2,C3,D4:F6")) Is Nothing Then
AutoFitMergedCellRowHeight Target
End Sub
Then use a version of Jim's macro like (untested):
Sub AutoFitMergedCellRowHeight(Optional rTarget As Range)
Dim CurrentRowHeight As Double
Dim MergedCellRgWidth As Double
Dim CurrCell As Range
Dim TargetCellWidth As Double
Dim PossNewRowHeight As Double
If rTarget Is Nothing Then Set rTarget = ActiveCell
If rTarget.MergeCells Then
With rTarget.MergeArea
If .Rows.Count = 1 And .WrapText = True Then
Application.ScreenUpdating = False
CurrentRowHeight = .RowHeight
TargetCellWidth = rTarget.ColumnWidth
For Each CurrCell In rTarget
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