Forum Discussion

Robert1290's avatar
Robert1290
Brass Contributor
Nov 12, 2021
Solved

Excel change row height based on font size

Hi,

 

Is there a way of making excel change the row height, dependant on the font size in the cells, e.g. if font size is 12, then make row height 18...

 

Thanks

 

Rob

17 Replies

    • Robert1290's avatar
      Robert1290
      Brass Contributor
      HansVogelaar

      Yes they will, and there are merged cells too.

      There will likely be 4 or 5 different font sizes in a document.

      Happy for VBA too, you helped me on my other VBA code that I still use 🙂

      Rob
      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Robert1290 

        Here is macro you can run:

        Sub FixHeights()
            Dim rng As Range
            Application.ScreenUpdating = False
            For Each rng In Intersect(Range("A:A"), ActiveSheet.UsedRange)
                rng.RowHeight = 1.5 * rng.Font.Size
            Next rng
            Application.ScreenUpdating = True
        End Sub

         

Resources