Automatic Row Height for Wrapped Text

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Hello peeps,

I would like to automatically adjust the row height for wrapped text (i.e., not do this manually). I also don't want to use the AutoFit Row Height because I want a default minimum height. I did find the following formula online which I have tried in the worksheet, ThisWorkbook, and a Module, but it's not working for me:

Sub AutofitRows()
For Each CL In UsedRange
If CL.WrapText Then CL.Rows.AutoFit
Next
End Sub

Any tips?

Ta muchly, folks! :)
 
How about
VBA Code:
Sub SaraWitch()
   Dim Cl As Range
   
   With ActiveSheet.UsedRange
      .EntireRow.AutoFit
      For Each Cl In .Columns(1).Offset(6).Resize(.Rows.Count - 6).Rows
         If Cl.RowHeight < 30.75 Then Cl.RowHeight = 30.75
      Next Cl
   End With
End Sub
 
Upvote 0
Solution

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,076
Messages
6,128,670
Members
449,463
Latest member
Jojomen56

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top