title: Autofit Row Height of Merged Cell in EPPlus
body: <p>I'm using EPPlus and C# and trying to autosize/autofit the height of a row to accommodate the height needed to show all of the contents of a merged cell with text wrapping. However no matter what I try the text always truncates. Since I'm repeating this process with various text sizes on various worksheets, I don't want to hard code the row height (except to enforce a minimum height for the row). If possible I'd like to do this within EPPlus/C#.</p>
  
  <p>With the cells A2:E2 merged and WrapText = true:</p>
  
  <p><strong>Cell with Text Truncated</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/lggJI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lggJI.png" alt="enter image description here"></a></p>
  
  <p><strong>Here's what it should look like with desired Cell Height</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/7YNau.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7YNau.png" alt="enter image description here"></a></p>
  
  <p>Here's my relevant and short C# code</p>
  
  <pre><code>Int32 intToCol;
  intToCol = 5;
  eppWorksheet.Cells[2, 1, 2, intToCol].Merge = true;
  eppWorksheet.Cells[2, 1].Style.WrapText = true; 
  //Check if at the minimum height. If not, resize the row
  if (eppWorksheet.Row(2).Height &lt; 35.25)
  {
      eppWorksheet.Row(2).Height = 35.25;
  }
  </code></pre>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/31496172/autofit-rows-in-epplus">Autofit rows in EPPlus</a> and it didn't seem to directly answer my question unless I'm reading it wrong.</p>