2017-09-15 193 views
0

我試圖在此格式中使用.style函數,但vba不想使用它。我剛剛使用.style錯誤還是需要使用其他方法來對單元格着色?Excel-vba:條件格式:單元格樣式

'Conditional Formatting 
.FormatConditions.Delete 
.FormatConditions.Add xlErrorsCondition, Formula1:= _ 
    "=IF(" & Cells(SelectedGroup, AreaSelected(2)).Offset(2, 1) & "=""Not Used"",TRUE, _ 
    FALSE)" 
.FormatConditions(1).Style = "Bad" 

.FormatConditions.Add xlErrorsCondition, Formula1:= _ 
    "=IF(" & Cells(SelectedGroup, AreaSelected(2)).Offset(2, 1) & "=""Used"",TRUE,FALSE)" 
.FormatConditions(1).Style = "Good" 
+1

據此,風格不是formatcondition的方法:https://msdn.microsoft.com/en-us/vba/excel-vba/articles/formatcondition-object-excel –

回答

相關問題