title: Autofit and minHeight in Excel Cell
body: <p>I created a small macro in Excel, which inserts a new sheet with certain names and makes some adjustments (formatting, background colors, column widths etc.). 
  This also works wonderfully.  </p>
  
  <p>My problem is that I want to give certain rows the property "Autofit" and a minimum height. The last has optical reasons. Autofit because it can be that the content becomes multiline. </p>
  
  <p>Unfortunately, I can't get the combination of the two. Either I have a height or the Autofit. </p>
  
  <p>Here is my existing code: </p>
  
  <pre><code>    Sheets(sn).Range("B4:H50").WrapText = True
      Sheets(sn).Range("B4:H50").Rows.AutoFit
     'Sheets(sn).Range("B4:H50").RowHeight = 30
  
      Dim Rng As Range
      Sheets(sn).Range("A4:H50").Select
      For Each Rng In Selection.Cells
          Rng.RowHeight = Application.WorksheetFunction.Min(Rng.RowHeight, 50)
      Next Rng
  </code></pre>
  
  <p>The attempt with the MinRowHeight I had found at Google. It sets the height correct, but then the autofit is deactivated again. </p>
  
  <p>Thank you very much</p>