Excel) (Range.Font 屬性

會傳回 Font 物件,代表指定之物件的字型。

語法

運算式字體

expression 代表 Range 物件的變數。

範例

本範例會判斷儲存格 A1 的字型名稱是否為 Arial,並通知使用者。

Sub CheckFont() 
 
 Range("A1").Select 
 
 ' Determine if the font name for selected cell is Arial. 
 If Range("A1").Font.Name = "Arial" Then 
 MsgBox "The font name for this cell is 'Arial'" 
 Else 
 MsgBox "The font name for this cell is not 'Arial'" 
 End If 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應