Hi guys,

Sorry but Im a beginner trying to do some pretty complex things.
Basically I am looking to autofit some merged cells.
I will need step-by-step instructions and I will be very appreciative.

I have found the programming script below which I assume will work but I am not sure if I need to change it at all to customise it or even how to insert it into Excel so that it autofits one row (206) when the Vlookup function I have inserted into one of the cells (206B) changes to another value.
Also how do I let it know which row I want to change?

The values which are inserted into this row can be a paragraph long or one word long so I want the row height to adjust.

I hope you can help. Please see below.

Quote

'\\ Simulates row height autofit for a merged cell if the active cell..
'\\ - is merged.
'\\ - has Wrap Text set.
'\\ - includes only 1 row.
'\\ Unlike real autosizing the macro only increases row height
'\\ (if needed). It does not reduce row height because another
'\\ merged cell on the same row may needed a greater height
'\\ than the active cell.
'----------------------------------------------

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
'<<=============

Unquote