Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default CONDITIONAL FORMATTING FOR MORE THAN 3 CRITERIA

I had placed the following question arround 5 days back:
___
I have a data like a figure reflected in A1 required to be:
1. Cell colored Green if Branch Name in B1 is "BR1";
2. Text to be bold if Region in C1 is "South";
3. Cell to be bordered thick if Segment in D1 is "Auto"; and
4. Text to be colored Red if Rate in E1 is 15%;

The problem is that a case may also be belonging to BR1 in SOUTH for AUTO
with RATE 15% thus the cell being:
Colored Green with Bold and Red Text Bordered Thickly;

All means macros codes shall be highly obliged!!!
___

Upon such a question, J. Sperry replied in a great manner as:
___
Sub FunkyFormat()
Range("a1").Select
If ActiveCell.Offset(0, 1) = "BR1" Then
With Selection.Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
End If
If ActiveCell.Offset(0, 2) = "South" Then Selection.Font.Bold = True
If ActiveCell.Offset(0, 3) = "Auto" Then
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End If
If ActiveCell.Offset(0, 4) 0.15 Then Selection.Font.ColorIndex = 3
End Sub
___

The problem is that such a code is not working as a conditional one, as upon
removal of the criterias the original cell does not revert back to the
original format;

AND

What if I need to apply such a conditional formatting on any active cell
instead of only Cell A1?

All help shall be highly obliged.

Thanx pals!!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default CONDITIONAL FORMATTING FOR MORE THAN 3 CRITERIA

Bob Phillips has a free add-in that you can download from he

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

It gives you 30 conditional formats in each cell.

Hope this helps.

Pete

On Feb 12, 4:36*am, FARAZ QURESHI
wrote:
I had placed the following question arround 5 days back:
___
I have a data like a figure reflected in A1 required to be:
1. Cell colored Green if Branch Name in B1 is "BR1";
2. Text to be bold if Region in C1 is "South";
3. Cell to be bordered thick if Segment in D1 is "Auto"; and
4. Text to be colored Red if Rate in E1 is 15%;

The problem is that a case may also be belonging to BR1 in SOUTH for AUTO
with RATE 15% thus the cell being:
Colored Green with Bold and Red Text Bordered Thickly;

All means macros codes shall be highly obliged!!!
___

Upon such a question, J. Sperry replied in a great manner as:
___
Sub FunkyFormat()
Range("a1").Select
If ActiveCell.Offset(0, 1) = "BR1" Then
* * With Selection.Interior
* * * * .ColorIndex = 10
* * * * .Pattern = xlSolid
* * End With
End If
If ActiveCell.Offset(0, 2) = "South" Then Selection.Font.Bold = True
If ActiveCell.Offset(0, 3) = "Auto" Then
* * Selection.Borders(xlDiagonalDown).LineStyle = xlNone
* * Selection.Borders(xlDiagonalUp).LineStyle = xlNone
* * With Selection.Borders(xlEdgeLeft)
* * * * .LineStyle = xlContinuous
* * * * .Weight = xlMedium
* * * * .ColorIndex = xlAutomatic
* * End With
* * With Selection.Borders(xlEdgeTop)
* * * * .LineStyle = xlContinuous
* * * * .Weight = xlMedium
* * * * .ColorIndex = xlAutomatic
* * End With
* * With Selection.Borders(xlEdgeBottom)
* * * * .LineStyle = xlContinuous
* * * * .Weight = xlMedium
* * * * .ColorIndex = xlAutomatic
* * End With
* * With Selection.Borders(xlEdgeRight)
* * * * .LineStyle = xlContinuous
* * * * .Weight = xlMedium
* * * * .ColorIndex = xlAutomatic
* * End With
End If
If ActiveCell.Offset(0, 4) 0.15 Then Selection.Font.ColorIndex = 3
End Sub
___

The problem is that such a code is not working as a conditional one, as upon
removal of the criterias the original cell does not revert back to the
original format;

AND

What if I need to apply such a conditional formatting on any active cell
instead of only Cell A1?

All help shall be highly obliged.

Thanx pals!!!


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
CONDITIONAL FORMATTING FOR MORE THAN 3 CRITERIA? FARAZ QURESHI Excel Discussion (Misc queries) 1 February 9th 08 03:39 PM
need help with conditional formatting 3 criteria [email protected] Excel Worksheet Functions 2 November 10th 06 12:55 PM
Conditional Formatting with more than 3 Criteria enginguven Excel Discussion (Misc queries) 4 October 31st 06 07:08 PM
Multiple Criteria for Conditional Formatting Dave Y Excel Worksheet Functions 4 March 21st 06 06:38 PM
Can I set more than three criteria for conditional formatting? River Excel Worksheet Functions 2 July 11th 05 08:57 AM


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