excel - Macro to color specific cells with specific data -


i have macro color cells has word void in it. works fine, have word void in cell this:[$189.00void] , can't find way change macro color cells contain : void , [$189.00void] or other dolor amount in it.

any suggestion ?

thanks.

here have:

sub macro1() on error resume next dim current string  = 1 65536 ' go first cell last  current = "c" & ' cell counter  range(current).select ' visit current cell  if range(current).text = "void" ' if says void we... selection.interior .colorindex = 3 ' ...go red .pattern = xlsolid .patterncolorindex = xlautomatic end end if  if range(current).text = "forwarded" ' if says forwarded we... selection.interior .colorindex = 4 ' ...go green .pattern = xlsolid .patterncolorindex = xlautomatic end end if next ' loop , check next cell end sub 

vba seems overkill this. pnuts said, conditional formatting need.

select cell(s) want format, home ribbon -> conditional formatting -> new rule -> format cells contain

then change first combo box cell value specific text. , in empty text box on right type void.

you can adjust cell formatting whatever want.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -