Hi! Apparently I am trying the impossible... I have a spreadsheet that yes, has merged cells (for presentation reasons, I can't change that) and some places need text inserted. WHen I create the "final copy" I need to be sure all text entered can be viewed (because the sheet will then be protected from further edits).
I had come across the following code as a work around
however, I can't for the life of me get it to work in my case!
Is there maybe another way? Or is there something else I can do instead? Insert a word doc? I don't know! grasping at straws where....
Thanks in adavnce for your suggestions.
I had come across the following code as a work around
Code:
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
however, I can't for the life of me get it to work in my case!
Is there maybe another way? Or is there something else I can do instead? Insert a word doc? I don't know! grasping at straws where....
Thanks in adavnce for your suggestions.