共用方式為


DataBarBorder.Color 屬性 (Excel)

會傳回指定資料橫條外框色彩的物件,此資料橫條是以設定格式化的條件規則指定。 唯讀。

語法

表達。顏色

代表 DataBarBorder 物件的變數。

傳回值

FormatColor

範例

下列程式碼範例會選擇儲存格範圍,並新增資料橫條格式化條件規則至該範圍。 然後,它會使用 BarBorder 屬性來擷取與該規則相關聯的 DataBarBorder 物件,並使用該物件的 Color 屬性來擷取 FormatColor 物件,以設定資料列框線的色彩和色調。

Range("A1:A10").Select 
Range("A1:A10").Activate 
 
Set myDataBar = Selection.FormatConditions.AddDatabar 
With myDataBar.BarBorder 
 .Type = xlDataBarBorderSolid 
 .Color.ThemeColor = xlThemeColorAccent2 
 .Color.TintAndShade = 0 
End With 

支援和意見反應

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