Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I've read through MANY of the posts for doing more than 4 conditional formats
in Excel. I've tried using several of the various examples provided by previous posters (entering code onto the worksheet tab "view code"), but nothing seems to work. Several people suggest using an add-in (xld cfP), but the website provided doesn't appear to be working. Here's my simple scenario . . . I have a row of data containing text (people's names as an example), and the text (person's name) can change depending on the formula in the cells within this row. I would like the cells to change color (not the font, just the interior color of the cell) based on the text (person's name) listed in each cell. For example: Carol Bob Tom Jerry Sue Sally Larry So for Carol, I would like the cell interior color to be red, bob to be blue, tom to be yellow, Jerry to be green, etc. (at this point, the colors do not matter, this is just an example). I've used several different scenarios provided by previous posters, but none seem to work, so I believe I may not be doing something correctly. I am using Excel 2003, and am an intermediate user. I've never used the VB code area before. Here's what I'm doing . . . I am on the worksheet with my data (people's names) in Row C (for example). I go to the tab, right click, and select View Code. A new screen appears with a blank window. I then paste in the code provided by a previous poster. I adjust the code to match my Row C, people's names, etc. I click save. I then go back to my excel worksheet, and no changes appear. What else do I need to do? Is there an add-in or something I need to load in order for the code change to appear? Help! Thanks in advance! Here's one of the sample codes provided by previous poster that I tried to use: Private Sub Worksheet_Change(ByVal Target As Range) Dim WatchRange As Range Dim CellVal As String If Target.Cells.Count 1 Then Exit Sub If Target = "" Then Exit Sub CellVal = Target Set WatchRange = Range("C1:C45") If Not Intersect(Target, WatchRange) Is Nothing Then Select Case CellVal Case "Carol" Target.Interior.ColorIndex = 5 Case "Steve" Target.Interior.ColorIndex = 10 Case "Lulu" Target.Interior.ColorIndex = 6 Case "Shara" Target.Interior.ColorIndex = 46 Case "Lilian" Target.Interior.ColorIndex = 45 End Select End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell colors on conditional format | Excel Discussion (Misc queries) | |||
Conditional Formatting Colors have disappear on my laptop. | Excel Worksheet Functions | |||
Conditional Formatting with Colours / Colors | Excel Worksheet Functions | |||
Conditional Formatting in 6 colors | Excel Discussion (Misc queries) | |||
Conditional Formatting Question - Different Cell Colors?? | Excel Discussion (Misc queries) |