Spørgsmål:
Flettede celler har ikke den korrekte højde efter en række pause. Hvordan kan jeg rette dette?
Svar:
Indsæt følgende kode i standardmodulet.
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 =. Falsk CurrentRowHeight = .RowHeight ActiveCellWidth = ActiveCell.ColumnWidth for hver CurrCell i markering MergedCellRgWidth = CurrCell.ColumnWidth + MergedCellRgWidth Næste .MergeCells = False .CellReg .Cell .R. ColumnWidth = ActiveCellWidth .MergeCells = True .RowHeight = IIf (CurrentRowHeight> PossNewRowHeight, _ CurrentRowHeight, PossNewRowHeight) End If End with End if Application.ScreenUpdating = True End Sub