ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formatting (https://www.excelbanter.com/excel-programming/327820-conditional-formatting.html)

Teresa

Conditional Formatting
 
Hi,

Conditional Formatting only allows 3 conditions, but I need 5,
so that in F Column, if I insert:

Won (cell turns green)
Proposed (cell turns amber)
Lost (cell turns red)

etc.etc.

I think this involves Worksheet_Change
and Target

Any help appreciated
Thanks






Toppers

Conditional Formatting
 
Try this:

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("F:F")) Is Nothing Then
With Target
Select Case .Value
Case Is = "Won"
.Interior.ColorIndex = 4
Case Is = "Proposed"
.Interior.ColorIndex = 44
Case Is = "Lost"
.Interior.ColorIndex = 3
Case is = .......
.interior.colorIndex= ???
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

HTH

"teresa" wrote:

Hi,

Conditional Formatting only allows 3 conditions, but I need 5,
so that in F Column, if I insert:

Won (cell turns green)
Proposed (cell turns amber)
Lost (cell turns red)

etc.etc.

I think this involves Worksheet_Change
and Target

Any help appreciated
Thanks






Jim Thomlinson[_3_]

Conditional Formatting
 
There is a download that you can get which allows you to do up to 30
conditional formats...

http://www.xldynamic.com/source/xld.....Download.html

Give it a look.

"teresa" wrote:

Hi,

Conditional Formatting only allows 3 conditions, but I need 5,
so that in F Column, if I insert:

Won (cell turns green)
Proposed (cell turns amber)
Lost (cell turns red)

etc.etc.

I think this involves Worksheet_Change
and Target

Any help appreciated
Thanks







All times are GMT +1. The time now is 11:38 PM.

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