ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Conditional Formating (https://www.excelbanter.com/excel-discussion-misc-queries/212466-excel-conditional-formating.html)

Martin D

Excel Conditional Formating
 
I have created a spreedsheet with a formula in CELL G133, which enters a text
sring contained in another Cell(s) dependant on the condition (result) of a
number in Cell F133. This works fine using the IF command.
CELL G133 Formula is =IF(F133<=4,T133,T134)

I now wish to change the colour of CELL G133 dependant on the Result of the
number in CELL F133 using conditional format. I have read most of the Q&A and
tried a few of them out. such as using Formula IS =f133<=4 turn cell to Green
but this does not appear to work. WHAT I AM DOING WRONG?

As a sup question I wish to have 4 different conditions but Excell 2003 only
appears to offer 3 options for conditional formating.

HELP PLEASE
--
Regards
Martin D

Mike H

Excel Conditional Formating
 
Martin,

You can use select case. Right click your sheet tab, view code and paste
this in.

Private Sub Worksheet_Calculate()
Select Case Range("G133").Value
Case Is = 123
icolor = 3
Case Is = 234
icolor = 4
Case Is = 345
icolor = 7
Case Is = 456
icolor = 9
Case Else
icolor = xlNone
End Select
Range("G133").Interior.ColorIndex = icolor
End Sub

Mike

"Martin D" wrote:

I have created a spreedsheet with a formula in CELL G133, which enters a text
sring contained in another Cell(s) dependant on the condition (result) of a
number in Cell F133. This works fine using the IF command.
CELL G133 Formula is =IF(F133<=4,T133,T134)

I now wish to change the colour of CELL G133 dependant on the Result of the
number in CELL F133 using conditional format. I have read most of the Q&A and
tried a few of them out. such as using Formula IS =f133<=4 turn cell to Green
but this does not appear to work. WHAT I AM DOING WRONG?

As a sup question I wish to have 4 different conditions but Excell 2003 only
appears to offer 3 options for conditional formating.

HELP PLEASE
--
Regards
Martin D


Martin D

Excel Conditional Formating
 
Mike,

Still a little confused, if I paste in your VBS (as it stands) what will
this achieve. or do I need to change the Case IS = to what I want it to equal
?
How will this refer to the value of cell F133 ?.
If Cell F133 <=4 I want Cell G133 to be GREEN
IF Cell F133 Between 5 and 9 I want Cell F133 and G133 to be YELLOW
If Cell F133 between 10 and 16 I want Cell F133 and G133 to be AMBER
If Cell F133 16 I want Cell F133 and G133 to be RED.
--
Regards
Martin D


"Mike H" wrote:

Martin,

You can use select case. Right click your sheet tab, view code and paste
this in.

Private Sub Worksheet_Calculate()
Select Case Range("G133").Value
Case Is = 123
icolor = 3
Case Is = 234
icolor = 4
Case Is = 345
icolor = 7
Case Is = 456
icolor = 9
Case Else
icolor = xlNone
End Select
Range("G133").Interior.ColorIndex = icolor
End Sub

Mike

"Martin D" wrote:

I have created a spreedsheet with a formula in CELL G133, which enters a text
sring contained in another Cell(s) dependant on the condition (result) of a
number in Cell F133. This works fine using the IF command.
CELL G133 Formula is =IF(F133<=4,T133,T134)

I now wish to change the colour of CELL G133 dependant on the Result of the
number in CELL F133 using conditional format. I have read most of the Q&A and
tried a few of them out. such as using Formula IS =f133<=4 turn cell to Green
but this does not appear to work. WHAT I AM DOING WRONG?

As a sup question I wish to have 4 different conditions but Excell 2003 only
appears to offer 3 options for conditional formating.

HELP PLEASE
--
Regards
Martin D



All times are GMT +1. The time now is 08:16 AM.

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