Conditional formatting with two conditiions

cajste

Board Regular
Joined
Oct 22, 2012
Messages
67
Hi,

I've been asked to setup a conditional formatting with coloured arrows based on two criterias. The direction of the arrow is determined by the development from last month and the colour of the arrow is determined by the present value compared to a target. I've been playing around to solve this but haven't any solution so far. Anyone having a good solution?

Brgds,
Caj
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I had a play around with this and came up with a solution using the up arrow (character 233) and down arrow (character 234) in the "Wingdings" font.

To test:
Open a new workbook.
Press Alt+F11 to open the vba editor window.
Click Insert => Module
Copy and paste the code.
Press F5 to run.
Edit the TEST and TARGET values and run again.


Rich (BB code):
Option Explicit


Sub test()
   Dim targetValue As Long
   Dim testValue As Long
   
   targetValue = 10
   testValue = 5
   
   If testValue < targetValue Then
      With Sheets("Sheet1").Range("A1")
         .Value = Chr(234)          'down arrow
         .Font.Name = "Wingdings"
         .Font.Color = vbRed
      End With
   Else
      With Sheets("Sheet1").Range("A1")
         .Value = Chr(233)          'up arrow
         .Font.Name = "Wingdings"
         .Font.Color = vbGreen
      End With
   End If
   
End Sub

Hope this gives you some ideas,
Bertie
 
Upvote 0
Thank's alot, will try it!

I came up with a similar solution, using the wingding font in a formula and conditional formatting to colour the arrows based on different thresholds for each KPI and month.

//Caj
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top