Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Manan
 
Posts: n/a
Default more than 3 conditional formating in excel

Hi
I am new to conditional formating in Excel.

In row 2 I need to enter nos. between 1-5. I want each color to have a
particular color. I have managed to do 4 (3 with conditional formating and
the 4th retaining the default color).

Is there a way i can do all 5 colors?

Thanks
  #2   Report Post  
Ken Wright
 
Posts: n/a
Default

You need to use VBA. Try this:-

Private Sub Worksheet_Calculate()
'Code must be placed in the codemodule of the actual sheet you are working
with.
Dim oCell As Range
For Each oCell In Range("A1:A20")
Select Case oCell.Value
Case Is < 1
oCell.Interior.ColorIndex = xlNone
Case Is = 1
oCell.Interior.ColorIndex = 5
Case Is = 2
oCell.Interior.ColorIndex = 3
Case Is = 3
oCell.Interior.ColorIndex = 6
Case Is = 4
oCell.Interior.ColorIndex = 4
Case Is = 5
oCell.Interior.ColorIndex = 7
Case Is = 6
oCell.Interior.ColorIndex = 15
Case Is = 7
oCell.Interior.ColorIndex = 40
Case Is 7
oCell.Interior.ColorIndex = xlNone
End Select
Next oCell
End Sub

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Manan" wrote in message
...
Hi
I am new to conditional formating in Excel.

In row 2 I need to enter nos. between 1-5. I want each color to have a
particular color. I have managed to do 4 (3 with conditional formating and
the 4th retaining the default color).

Is there a way i can do all 5 colors?

Thanks



  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Maman

How about 6 colors without using code?

JE McGimpsey points out a method of combining CF and Custom format.

http://www.mcgimpsey.com/excel/conditional6.html


Gord Dibben Excel MVP

On Mon, 7 Feb 2005 12:03:03 -0800, "Manan"
wrote:

Hi
I am new to conditional formating in Excel.

In row 2 I need to enter nos. between 1-5. I want each color to have a
particular color. I have managed to do 4 (3 with conditional formating and
the 4th retaining the default color).

Is there a way i can do all 5 colors?

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Conditional formating in Excel Charts. REvans Charts and Charting in Excel 4 January 27th 05 11:53 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
Conditional Formats in Excel DaveB Excel Worksheet Functions 2 November 15th 04 07:36 AM
Conditional formating in excel Rocempire Excel Worksheet Functions 0 November 6th 04 05:04 PM


All times are GMT +1. The time now is 07:22 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"