Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the macro developed by Jim Rech, will adjust the height of a
merged/wrapped cell in a single row and have changed it from : Sub AutoFitMergedCellRowHeight() * code here * end sub To: Private Sub Worksheet_Change(ByVal Target As Range) 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 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 End With End If End Sub This is to activate the macro automatically when the merged cells are changed and the enter key is pressed but it is not working. It is located in a module and other test code will run successfully. Office 2003. What am I missing? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set a minimum row height a the same time with autofit row height | New Users to Excel | |||
Row Height stopped growing and Auot-Fit Row Height does not work | Excel Discussion (Misc queries) | |||
the row height should be excatly the height of the data | Excel Discussion (Misc queries) | |||
Resizing row height to dynamically fit height of text box | Excel Discussion (Misc queries) | |||
Set new row height based on current height | Excel Programming |