返回一个
Font 对象,它代表指定对象的字体。
语法
表达式.Font
表达式 一个代表 Range 对象的变量。
示例
此示例判断单元格 A1 的字体名称是否为 Arial,并通知用户。
示例代码 |
function CheckFont(){
Range("A1").Select()
// Determine if the font name for selected cell is Arial.
if(Range("A1").Font.Name == "Arial") {
MsgBox("The font name for this cell is 'Arial'")
}
else {
MsgBox("The font name for this cell is not 'Arial'")
}
}
|