Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sample worksheet event code for 10 conditions and colors.
Adjust range, vals and nums to suit. Private Sub Worksheet_Change(ByVal Target As Range) Set r = Range("A1:A100") If Intersect(Target, r) Is Nothing Then Exit Sub End If vals = Array("C", "D", "G", "H", "K", "L", "O", "S", "C", "X") 'conditions nums = Array(8, 9, 6, 3, 7, 4, 20, 10, 13, 15) ' color fill For Each rr In r icolor = 0 For i = LBound(vals) To UBound(vals) If UCase(rr.Value) = vals(i) Then icolor = nums(i) End If Next If icolor 0 Then rr.Interior.ColorIndex = icolor End If Next End Sub This is event code. Right-click on the sheet tab and "View Code". Copy/paste into that sheet module. Make your edits then Alt + q to return to Excel. Gord Dibben MS Excel MVP On Wed, 19 May 2010 02:23:01 -0700, Pomodoro wrote: Hi, I have 6 different investigation area, one single name each, and I would like to set 6 different conditional formatting. But I'm not able to set more than 3. Any idea how can I manage it? Many thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting--different formatting depending on cell con | Excel Discussion (Misc queries) | |||
Formatting Conditional Formatting Icon Sets | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |