Something like this (and easily found on google):
Dim g As Graphics = Me.CreateGraphics()
Dim textSize As Size = g.MeasureString(cInDef, Me.Font).ToSize()
apExcel.ActiveCell.MergeArea.RowHeight = _
apExcel.ActiveSheet.StandardHeight * _
(Int(textSize.Width / apExcel.ActiveCell.MergeArea.Width * nScaleFactor) + 1)
g.Dispose()