excel - String in a conditional formatting formula in vba -


i want format column g if column d has "ai" in same row using vba in excel 2007.

if manually in conditional formatting editor formula =(d1 = "ai") works correctly.

if try add formula formula1 clause of formatconditions.add method must put ="(d1 = ""ai"")" or interpreter complains. copied literally doubled double quotes condition , formatting nothing.

what should put in formula1 ?

antonio

this worked me:

sub macro2()  sheet1.range("g1").select sheet1.range("g:g")     .formatconditions.delete     .formatconditions.add type:=xlexpression, formula1:="=f1=""ai"""     .formatconditions(1).interior.colorindex = 3 end end sub 

also, using vba set conditional formatting has been bit wonky (for me @ least). way work select g1 , set formatting. know typically don't need select, in case it's way work.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -