2017-09-15 24 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 –

答えて