ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Colour cells of specific value? (https://www.excelbanter.com/excel-discussion-misc-queries/117159-colour-cells-specific-value.html)

rj

Colour cells of specific value?
 
Hi all,

I want a macro that checks through the current worksheet and colours
every cell that has a specified value.. Eg. if F12 has "BAD" typed in
it, then F12 should be coloured red..

thanks in advance..


Mike

Colour cells of specific value?
 
You don't need a macro simply use conditional formatting. select all the
cells on the worksheet and set up the conditional format to be red if the
cell contents match your criteria.

Mike

"rj" wrote:

Hi all,

I want a macro that checks through the current worksheet and colours
every cell that has a specified value.. Eg. if F12 has "BAD" typed in
it, then F12 should be coloured red..

thanks in advance..



Bob Phillips

Colour cells of specific value?
 
See http://www.contextures.com/xlCondFormat01.html

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rj" wrote in message
ps.com...
Hi all,

I want a macro that checks through the current worksheet and colours
every cell that has a specified value.. Eg. if F12 has "BAD" typed in
it, then F12 should be coloured red..

thanks in advance..




rj

Colour cells of specific value?
 
thanx, that would work, but i need it as part of a macro so the changes
take place (and other changes as well) when i click a button..


On Nov 2, 1:32 pm, "Bob Phillips" wrote:
Seehttp://www.contextures.com/xlCondFormat01.html

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rj" wrote in glegroups.com...

Hi all,


I want a macro that checks through the current worksheet and colours
every cell that has a specified value.. Eg. if F12 has "BAD" typed in
it, then F12 should be coloured red..


thanks in advance..



Bob Phillips

Colour cells of specific value?
 
With Range("F12")
If .Value = "BAD" Then
.Interior.Colorindex = 3
Else
.Interior.Colorindex = xlColorindexNone
End If
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rj" wrote in message
ups.com...
thanx, that would work, but i need it as part of a macro so the changes
take place (and other changes as well) when i click a button..


On Nov 2, 1:32 pm, "Bob Phillips" wrote:
Seehttp://www.contextures.com/xlCondFormat01.html

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rj" wrote in

glegroups.com...

Hi all,


I want a macro that checks through the current worksheet and colours
every cell that has a specified value.. Eg. if F12 has "BAD" typed in
it, then F12 should be coloured red..


thanks in advance..






All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com