VBA Code: Autofit Row Heights & Wrap Text With Merged Ce

otrevino3

New Member
Joined
Jan 25, 2005
Messages
22
The row heights from row 40 down to the end of my data range need to be autofitted. My Data range stops at around row 50.

The contents of rows 40 to end of range also need to be formatted with wrap text.

**Rows 40 down contain merged cells (i.e b40:d40 are merged; f40:h40 are also merged).**

Tactps posted some VBA that I tweeked a little, but after playing with it, I ended up with row 40 being sized to 12.75.

Here is the Tactps' raw VBA

Private Sub Worksheet_Calculate()
[a1].RowHeight = (Int((Len([a1]) / 30)) + 1) * 12.75
End Sub

Are there any VBA gurus out there that can help me tweek this VBA? I'd prefer not to unmerge all of these cells (there are quite a few).
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,118,812
Messages
5,574,456
Members
412,595
Latest member
slim313
Top