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"
据此,风格不是formatcondition的方法:https://msdn.microsoft.com/en-us/vba/excel-vba/articles/formatcondition-object-excel –