To center a merged cell both vertically and horizontally, do the following:
ws.Cells[$"A{row}"].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
ws.Cells[$"A{row}"].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
If you need to do something with row height, you need to look at the parameter CustomHeight. That should explain this: Auto-matching strings in EPPlus
Ernie source
share