Fråga:
Sammanslagna celler har inte rätt höjd efter ett radbrytning. Hur kan jag rätta till detta?
Svar:
Sätt in följande kod i standardmodulen.
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.CountExt = 1. Falsk CurrentRowHeight = .RowHeight ActiveCellWidth = ActiveCell.ColumnWidth för varje CurrCell i urvalet MergedCellRgWidth = CurrCell.ColumnWidth + MergedCellRgWidth Nästa .MergeCells = False .CellReg .Cell .Rel .Cell. ColumnWidth = ActiveCellWidth .MergeCells = True .RowHeight = IIf (CurrentRowHeight> PossNewRowHeight, _ CurrentRowHeight, PossNewRowHeight) End If End with End if Application.ScreenUpdating = True End Sub