IronXL How-Tos Font & Size How to Set Cell Font and Size Chaknith Bin Updated:July 28, 2025 Customizing font properties, including font name, size, color, underline, bold, italic, script, and strikeout, offers numerous benefits in document formatting. These options empower you to improve readability, emphasize critical information, and create visually appealing documents. With IronXL, you can effortlessly edit font properties without interop in C# .NET, simplifying the process and enabling you to create professional and polished materials effortlessly. How to Set Cell Font and Size Download the C# library to set font and size Open an existing Excel spreadsheet or create a new one Use Font properties to customize font appearance, such as name, size, and boldness Set the Font to italic, strikeout, or use FontScript Explore all available options for underlining Get started with IronXL Start using IronXL in your project today with a free trial. First Step: Start for Free Set Cell Font and Size Example To personalize the font of a selected cell, column, row, or range, simply set the Font properties of the Style. Utilize the Name property to set the desired font family, the Height property to adjust the font size, and the Bold property to emphasize the font weight. Additionally, you can employ the Underline property to add underlining for further visual emphasis. Please noteThe Name property sets the font name exactly as provided. For instance, if you want to use the "Times New Roman" font, make sure to input it exactly with the same spaces and capital letters. :path=/static-assets/excel/content-code-examples/how-to/cell-font-size-set-font.cs using IronXL; using IronXL.Styles; WorkBook workBook = WorkBook.Create(); WorkSheet workSheet = workBook.DefaultWorkSheet; workSheet["B2"].StringValue = "Font and Size"; // Set font family workSheet["B2"].Style.Font.Name = "Times New Roman"; // Set font size workSheet["B2"].Style.Font.Height = 15; // Set font to bold workSheet["B2"].Style.Font.Bold = true; // Set underline workSheet["B2"].Style.Font.Underline = FontUnderlineType.Single; workBook.SaveAs("fontAndSize.xlsx"); Imports IronXL Imports IronXL.Styles Private workBook As WorkBook = WorkBook.Create() Private workSheet As WorkSheet = workBook.DefaultWorkSheet Private workSheet("B2").StringValue = "Font and Size" ' Set font family Private workSheet("B2").Style.Font.Name = "Times New Roman" ' Set font size Private workSheet("B2").Style.Font.Height = 15 ' Set font to bold Private workSheet("B2").Style.Font.Bold = True ' Set underline Private workSheet("B2").Style.Font.Underline = FontUnderlineType.Single workBook.SaveAs("fontAndSize.xlsx") $vbLabelText $csharpLabel Set Cell Font and Size Advanced Example In addition to the options discussed in the previous section, you can further customize the font appearance in Excel. This includes setting the font to Italic, applying Strikeout, using FontScript for super and subscripts, and choosing a specific font color. Below is an example demonstrating how to utilize these additional options to create personalized font styles for your cells. :path=/static-assets/excel/content-code-examples/how-to/cell-font-size-set-font-advanced.cs using IronXL; using IronXL.Styles; WorkBook workBook = WorkBook.Create(); WorkSheet workSheet = workBook.DefaultWorkSheet; workSheet["B2"].StringValue = "Advanced"; // Set font family workSheet["B2"].Style.Font.Name = "Lucida Handwriting"; // Set font script workSheet["B2"].Style.Font.FontScript = FontScript.None; // Set underline workSheet["B2"].Style.Font.Underline = FontUnderlineType.Double; // Set bold property workSheet["B2"].Style.Font.Bold = true; // Set italic property workSheet["B2"].Style.Font.Italic = false; // Set strikeout property workSheet["B2"].Style.Font.Strikeout = false; // Set font color workSheet["B2"].Style.Font.Color = "#00FFFF"; workBook.SaveAs("fontAndSizeAdvanced.xlsx"); Imports IronXL Imports IronXL.Styles Private workBook As WorkBook = WorkBook.Create() Private workSheet As WorkSheet = workBook.DefaultWorkSheet Private workSheet("B2").StringValue = "Advanced" ' Set font family Private workSheet("B2").Style.Font.Name = "Lucida Handwriting" ' Set font script Private workSheet("B2").Style.Font.FontScript = FontScript.None ' Set underline Private workSheet("B2").Style.Font.Underline = FontUnderlineType.Double ' Set bold property Private workSheet("B2").Style.Font.Bold = True ' Set italic property Private workSheet("B2").Style.Font.Italic = False ' Set strikeout property Private workSheet("B2").Style.Font.Strikeout = False ' Set font color Private workSheet("B2").Style.Font.Color = "#00FFFF" workBook.SaveAs("fontAndSizeAdvanced.xlsx") $vbLabelText $csharpLabel Underline In Excel, there are different types of underlines available for text formatting. One such option is the Accounting underline, which has additional spacing between the characters and the lines compared to the normal underline. For text entries, the underline extends beyond the value both in front and back. However, for numeric data formats, the underline remains confined to the value. In cases where a cell contains both numbers and other characters, the Accounting underline will behave similarly to text. Font Script Font script in IronXL offers three options: none, super, and sub. none: The default option, setting the font on the baseline for regular text appearance. super: Positions text characters above the baseline for exponents or footnotes. sub: Positions text characters below the baseline for chemical formulas and math notations. Font Color You can set the font color using either the Color property or the SetColor method. The SetColor method accepts input in the form of IronSoftware.Drawing.Color or a Hex color code. :path=/static-assets/excel/content-code-examples/how-to/cell-font-size-set-font-color.cs using IronXL; using IronSoftware.Drawing; WorkBook workBook = WorkBook.Create(); WorkSheet workSheet = workBook.DefaultWorkSheet; // Set Color property workSheet["B2"].Style.Font.Color = "#00FFFF"; // Use Hex color code workSheet["B2"].Style.Font.SetColor("#00FFFF"); // Use IronSoftware.Drawing workSheet["B2"].Style.Font.SetColor(Color.Red); Imports IronXL Imports IronSoftware.Drawing Private workBook As WorkBook = WorkBook.Create() Private workSheet As WorkSheet = workBook.DefaultWorkSheet ' Set Color property Private workSheet("B2").Style.Font.Color = "#00FFFF" ' Use Hex color code workSheet("B2").Style.Font.SetColor("#00FFFF") ' Use IronSoftware.Drawing workSheet("B2").Style.Font.SetColor(Color.Red) $vbLabelText $csharpLabel Frequently Asked Questions How can I change the font size in an Excel spreadsheet using C#? In IronXL, you can change the font size by accessing the Height property of the Font object. For example, set cell.Style.Font.Height to your desired size. What are the available font customization options in IronXL? IronXL allows customization of font properties such as name, size, color, boldness, italic, underline, strikeout, and script (super or subscript). How do I make text bold in an Excel cell using C#? To make text bold, set the Bold property of the Font object to true. For example, use cell.Style.Font.Bold = true in IronXL. Is it possible to apply italic and strikeout styles to text in Excel with C#? Yes, you can apply italic by setting cell.Style.Font.Italic = true and strikeout by setting cell.Style.Font.Strikeout = true in IronXL. How can I underline text in an Excel cell using IronXL? Use the Underline property of the Font object to apply underlining. For example, use cell.Style.Font.Underline = ExcelFont.UnderlineType.Single. What font script options are available in IronXL? IronXL provides three font script options: none (default), super (for superscript), and sub (for subscript). How do I change the font color in an Excel cell using C#? You can change the font color in IronXL using the Color property or SetColor method. For instance, use cell.Style.Font.Color = Color.Red or cell.Style.Font.SetColor("#FF0000"). What is the Accounting underline in Excel? The Accounting underline is a type of underline that includes additional spacing and is typically used with numeric values, extending beyond the text entries. How do I load and save an Excel file using IronXL? To load an Excel file in IronXL, use WorkBook.Load("example.xlsx"). To save changes, use workbook.SaveAs("example_modified.xlsx"). Can I set a specific font family in an Excel cell using C#? Yes, you can set a specific font family by assigning the desired font name to cell.Style.Font.Name, such as 'Arial' or 'Times New Roman' in IronXL. Chaknith Bin Chat with engineering team now Software Engineer Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience. Ready to Get Started? Free NuGet Download Total downloads: 1,558,208 View Licenses