Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 1
Default 4 or 5 conditional formats

Hi

I need to create a rule for 4 or 5 kinds of formulas' results.
This file is like a traffic light but additional to 3 main colors I need
white background for a 4th rule and NO background for empty cells.

Can you help me please?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 10,593
Default 4 or 5 conditional formats

An example


'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10" '<=== change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Portugal01" wrote in message
...
Hi

I need to create a rule for 4 or 5 kinds of formulas' results.
This file is like a traffic light but additional to 3 main colors I need
white background for a 4th rule and NO background for empty cells.

Can you help me please?

Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
More than 3 Conditional Formats Kris_Wright_77 Excel Discussion (Misc queries) 0 February 15th 07 08:31 PM
Conditional Formats RUSH2CROCHET Excel Discussion (Misc queries) 4 June 9th 06 05:52 PM
More than 3 conditional formats? Ltat42a Excel Discussion (Misc queries) 12 January 6th 06 11:26 AM
How do I add more Conditional Formats? Saint Excel Discussion (Misc queries) 2 April 26th 05 07:30 PM
Any way to have more than three conditional formats? Bill Brehm Excel Worksheet Functions 1 December 7th 04 09:37 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"