LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 4 conditional format


Hi Rick,

Thanks for the quick reply. It does work but not serving my purpose. I
think, I need to be more clear.

Actually in B1:AE1, I have a formulae i.e,. =TEXT(B2,"ddd");
=TEXT(B3,"ddd"); and so on till =TEXT(AE2,"ddd") which converts the dates in
B2:AE2 i.e. 1-May-2008 to "Thu"; 2-May-2008 to "Fri" and so on.

*** Now, I want to change the color of the range D1:AE2 by giving the
following conditions:

If B1=Sat, change color to RED
If C1=Sun, change color to BLUE

Also

There is a range A1:AE1 containing "Holiday" and "Working" in drop-down list.

If A1=Holiday, change color to ORANGE
If A1=Working, Change color to GREEN

***The color should change not only in the range B1:AE1 but also in D1:AE2
appropriately, if he conditions satisfies.

In this case it only changes in B1:AE1 and NOT in D1:AE2, and only when it
is entered manually. It does not change the background when their is formulae
or a drop-down list.

I know, its a two set of conditioning having the ranges B1:AE1 and A1:AE1
based on which the formatting should be applied to the third set of range
D1:AE2.

Iam sure their is some way out for this. Please help.

Thanks in advance,
Prashanth KR.


"Rick Rothstein (MVP - VB)" wrote:

Instead of a macro that you have to run manually, use this event code
instead which will react to changes in the range B1:AE1 just as the
Conditional Formatting would do...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B1:AE1")) Is Nothing Then
With Target
Select Case .Value
Case "Sat"
.Cells.Interior.ColorIndex = 3
Case "Sun"
.Cells.Interior.ColorIndex = 41
Case "Holiday"
.Cells.Interior.ColorIndex = 45
Case "Working"
.Cells.Interior.ColorIndex = 4
Case Else
.Cells.Interior.ColorIndex = xlNone
End Select
End With
End If
End Sub

Copy/Paste the code into the code window for the worksheet you want this
functionality on.

Rick


"Prashanth KR" wrote in message
...
Hi,

In a range B1:AE1, I have formulaes which converts the date from B2:AE2
to
days i.e., €œSun€, €œMon€, €œTue€ and so on. I only change the first day of
every month in B2 where all dates gets auto-populated in the subsequent
range
of cells.

Now I want to give more than 3 Conditional formatting which stands as
below:
If B1=Sat, change color to RED
If C1=Sun, change color to BLUE
If A1=Holiday, change color to ORANGE
If A1=Working, Change color to GREEN

These formatting needs to be applied to the range D1:AE2. I could succeed
in
doing the first 3 by using the CF method which is limited to only 3 at a
time. I am using Excel 2003.

I dont want the background to change to any default color in the range
D1:AE2 other than WHITE.

Please suggest a macro for the same. I shall be very grateful to you.

Thanks in advance,
Prashanth KR.



 
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
Conditional Format overwrighting previous conditional format davethewelder Excel Programming 2 April 10th 08 04:01 PM
New Conditional Format Overriding Previous Conditional Format Rene Excel Discussion (Misc queries) 3 February 27th 08 06:08 PM
Multiple conditional on conditional format formula Frank Kabel Excel Programming 1 July 27th 04 06:24 PM
Multiple conditional on conditional format formula Bob Phillips[_7_] Excel Programming 0 July 27th 04 05:30 PM
Keep format after paste from other worksheets - conditional format or EnableControl solution doesn't work No Name Excel Programming 0 May 3rd 04 12:22 PM


All times are GMT +1. The time now is 07:14 PM.

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

About Us

"It's about Microsoft Excel"