J
JoJo
If anyone is interested, I found a way to automatically adjust a row
height based on merged cells text. Here's how I did it...
In a cell unmerged and on the same row as the merged cells, enter the
formula = merged cells and set the formula cell to the same column
width as the combined merged cells. For example: Merged cells are
B2
2, formula in F2 is "=B2". Then set column F width to match merged
cells. So if the merged cells combined column width is 30, set column F
width 30.
Then in the worksheet VBA, use this code. This will automatically
adjust the row height after the text in cell B2 is entered.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 2 Then
ActiveSheet.Rows(2).AutoFit
End If
End Sub
Happy VBAing.
height based on merged cells text. Here's how I did it...
In a cell unmerged and on the same row as the merged cells, enter the
formula = merged cells and set the formula cell to the same column
width as the combined merged cells. For example: Merged cells are
B2
cells. So if the merged cells combined column width is 30, set column F
width 30.
Then in the worksheet VBA, use this code. This will automatically
adjust the row height after the text in cell B2 is entered.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 2 Then
ActiveSheet.Rows(2).AutoFit
End If
End Sub
Happy VBAing.