How to use different colors of texts in the same Excel cell using ClosedXML?
worksheet.Cell(1,1).Value.Character[StartIndex, NoOfChar].Font.Color....??
ClosedXML doesn't have something like above, please help me to use two different font colors in the same cell.
Use RichText
to style different parts of the cell, for example:
worksheet.Cell(1,1).RichText.Substring(StartIndex, NoOfChar).SetFontColor(XLColor.Red);
See the documentation for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With