NativeExcel2 for .Net Developer's Reference

IRange.Font Property

Returns an IFont interface that represents the font of the specified range

[Visual Basic]

Property Value

IFont interface.


This example sets the font and font size for A1:F2 cells on first sheet to 12-point bold Arial.

IFont font = book.Worksheets[1].Range["A1:F2"].Font;
font.Name = "Arial";
font.Size = 12;
font.Bold = true;
Dim font As IFont = book.Worksheets(1).Range("A1:F2").Font
font.Name = "Arial"
font.Size = 12
font.Bold = True
IFont* font = book->Worksheets->Item[1]->Range->Item[S"A1:F2"]->Font;
font->Name = S"Arial";
font->Size = 12;
font->Bold = true;

See Also

IRange Interface | NativeExcel Namespace | IFont Interface