Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Novel approach, using VBA to do what CF does very easily.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Martin" wrote in message ... I don't think conditional formatting's that clever. Here's a macro that'll do the job - just make sure you select all the values in column A before you run it: Sub myConditionalFormat() Dim myCell As Range For Each myCell In Selection If myCell.Value < myCell.Offset(0, 2).Value And myCell.Value < 0 Then myCell.Interior.ColorIndex = 4 ElseIf myCell.Value myCell.Offset(0, 2).Value And myCell.Value < 0 Then myCell.Interior.ColorIndex = 5 ElseIf myCell.Value = 0 Then myCell.Interior.ColorIndex = 1 End If Next End Sub If you haven't done macros before, go to the VB Editor (from Tools, Macro), click on Insert, Module and then paste the above into it. To run it, select your values in column A and then click Tools, Macro, Macros and double-click myConditionalFormat in the list. "carl" wrote: I have these 3 conditions I am trying to set my conditional filtering for: 1. if A1<C1 and A1<0 color the cell green 2. if A1C1 and A1<0 color the cell blue 3. if A1=0 color the cell black Thank you in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional if or filtering in pivot table | Excel Worksheet Functions | |||
Conditional Format Not Working | Excel Discussion (Misc queries) | |||
how do I maintain my conditional formatting when filtering cells? | Excel Worksheet Functions | |||
Filtering out text with conditional formatting | Excel Discussion (Misc queries) | |||
Conditional Filtering | Excel Worksheet Functions |