共用方式為


Interior.PatternColorIndex 屬性 (Excel)

會傳回或設定內景圖樣的色彩為目前調色盤中、 索引或下列 其中一個 XlColorIndex 常數之一: xlColorIndexAutomaticxlcolorindexnone: 一起 。 讀取/寫入的 Long

語法

運算式PatternColorIndex

表達 代表 Interior 物件的變數。

註解

將本屬性設定為 xlColorIndexAutomatic,表示儲存格使用自動圖樣或繪圖物件使用自動填滿樣式。

將本屬性設定為 xlColorIndexNone,則表示不希望使用圖樣 (等於將 Interior 物件的 Pattern 屬性設定為 xlPatternNone)。

範例

此範例對 Sheet1 中第一個矩形內部圖樣的色彩進行設定。

With Worksheets("Sheet1").Rectangles(1).Interior 
 .Pattern = xlChecker 
 .PatternColorIndex = 5 
End With

支援和意見反應

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