Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 2nd Conditional Formatting?

I want to set more than 3 conditional formats where the background color changes in one cell based on values found in two other columns within the worksheet. I need to setup at least 4-5 conditional formats. The actual conditonal formatting used now in the spreadsheet is as follows. So if there is a value of 1 thru 6 in column I or a valued of Green, Amber, Red, or Blue in column D, then I want to format the background color in a Monthly column of 1-6 as that particular color. I'm at a loss as to where to begin.

=(AND($I5=1,$D5="Green"))
=(AND($I5=1,$D5="Amber"))
=(AND($I5=1,$D5="Red"))

=(AND($I6=2,$D6="Green"))
=(AND($I6=2,$D6="Red"))
=(AND($I6=2,$D6="Amber"))

=(AND($I24=3,$D24="Green"))
=(AND($I24=3,$D24="Red"))
=(AND($I24=3,$D24="Amber"))

I know that I could create a select case statement to color in the background, but I'm not sure how to code this to indicate when/where that should be done.

Case "Red"
oCell.Interior.ColorIndex = 3
oCell.Font.ColorIndex = 1
oCell.Font.Bold = True

Any hints that you can give to get stated would be much appreciated? Worth at least 10 stars in my book.

Thanks and have a great day.

RonS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 2nd Conditional Formatting?

depends on when you want to trigger the code. If the change to a cell will
only be done manually, then you can use the worksheet_change event. (right
click on the sheet tab and select view code. in the top of the resulting
module select worksheet from the left and Change from the right - not
SelectionChange).

--
Regards,
Tom Ogilvy

"RonS" wrote in message
...
I want to set more than 3 conditional formats where the background color

changes in one cell based on values found in two other columns within the
worksheet. I need to setup at least 4-5 conditional formats. The actual
conditonal formatting used now in the spreadsheet is as follows. So if
there is a value of 1 thru 6 in column I or a valued of Green, Amber, Red,
or Blue in column D, then I want to format the background color in a Monthly
column of 1-6 as that particular color. I'm at a loss as to where to begin.

=(AND($I5=1,$D5="Green"))
=(AND($I5=1,$D5="Amber"))
=(AND($I5=1,$D5="Red"))

=(AND($I6=2,$D6="Green"))
=(AND($I6=2,$D6="Red"))
=(AND($I6=2,$D6="Amber"))

=(AND($I24=3,$D24="Green"))
=(AND($I24=3,$D24="Red"))
=(AND($I24=3,$D24="Amber"))

I know that I could create a select case statement to color in the

background, but I'm not sure how to code this to indicate when/where that
should be done.

Case "Red"
oCell.Interior.ColorIndex = 3
oCell.Font.ColorIndex = 1
oCell.Font.Bold = True

Any hints that you can give to get stated would be much appreciated?

Worth at least 10 stars in my book.

Thanks and have a great day.

RonS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 2nd Conditional Formatting?

See my reply to your first question.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RonS" wrote in message
...
I want to set more than 3 conditional formats where the background color

changes in one cell based on values found in two other columns within the
worksheet. I need to setup at least 4-5 conditional formats. The actual
conditonal formatting used now in the spreadsheet is as follows. So if
there is a value of 1 thru 6 in column I or a valued of Green, Amber, Red,
or Blue in column D, then I want to format the background color in a Monthly
column of 1-6 as that particular color. I'm at a loss as to where to begin.

=(AND($I5=1,$D5="Green"))
=(AND($I5=1,$D5="Amber"))
=(AND($I5=1,$D5="Red"))

=(AND($I6=2,$D6="Green"))
=(AND($I6=2,$D6="Red"))
=(AND($I6=2,$D6="Amber"))

=(AND($I24=3,$D24="Green"))
=(AND($I24=3,$D24="Red"))
=(AND($I24=3,$D24="Amber"))

I know that I could create a select case statement to color in the

background, but I'm not sure how to code this to indicate when/where that
should be done.

Case "Red"
oCell.Interior.ColorIndex = 3
oCell.Font.ColorIndex = 1
oCell.Font.Bold = True

Any hints that you can give to get stated would be much appreciated?

Worth at least 10 stars in my book.

Thanks and have a great day.

RonS



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
How can I convert conditional formatting into explicit formatting? Patrick Harris Excel Discussion (Misc queries) 0 April 9th 09 12:00 AM
Conditional formatting--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


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