は、私は私が唯一の文字列を変更していconditionnal整形のためにこのコードを持っている:VBA、同じ色、複数の文字列での条件付き書式設定?
Cells.FormatConditions.Delete
With Range("$A$1:$H$17").FormatConditions.Add(Type:=xlTextString, String:="CPA", TextOperator:=xlContains)
.Interior.Color = RGB(105, 191, 44)
End With
With Range("$A$1:$H$17").FormatConditions.Add(Type:=xlTextString, String:="CPN", TextOperator:=xlContains)
.Interior.Color = RGB(105, 191, 44)
End With
With Range("$A$1:$H$17").FormatConditions.Add(Type:=xlTextString, String:="CSS", TextOperator:=xlContains)
.Interior.Color = RGB(105, 191, 44)
End With
With Range("$A$1:$H$17").FormatConditions.Add(Type:=xlTextString, String:="RL", TextOperator:=xlContains)
.Interior.Color = RGB(105, 191, 44)
End With
は、これらすべての行のための任意の代替がありますので、私はより短く、より効果的な方法でそれを書くことができますか?
このマクロは、「CPAzergfzergfer」を含むセルであっても色付けされます。正確な文字列を含むセルのみを色付けするマクロをどのように書くことができますか?
は、プログラミング言語を明記してくださいあなたは適切なタグを使用して追加しています –
ただそれを更新しました、ありがとうOhad Eytan –