Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to set AutoFit property in Excel for merged cells
Using JScript.
I have merged some amount of cells and type some text in. How can I to set autofit for text in merged cells |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to set AutoFit property in Excel for merged cells
So far as I'm aware, Autofit does not work for merged cells (Excel 2002)
-- Roger Shaftesbury (UK) "Roman Malakhovetskyy" wrote in message ... Using JScript. I have merged some amount of cells and type some text in. How can I to set autofit for text in merged cells |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to set AutoFit property in Excel for merged cells
Merged cells done support Autofit.
You might pursue some code like this posted by Jim Rech: Jim Rech 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 .WrapText = True 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 -- Regards, Tom Ogilvy "Roman Malakhovetskyy" wrote in message ... Using JScript. I have merged some amount of cells and type some text in. How can I to set autofit for text in merged cells |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
Is there a way to Autofit Merged Cells in a row? | Excel Discussion (Misc queries) | |||
Autofit Merged Cells in Excel | Excel Discussion (Misc queries) | |||
Autofit in Merged Cells? | Excel Discussion (Misc queries) | |||
How do I "Wrap Text" & "Autofit" within Merged Cells in Excel? | Excel Worksheet Functions |