More than 3 Cond. Formats??
You'll need a macro. Right click on sheet tab, view code. Paste the following
in:
'=======
Sub ColorCheck()
Dim i As Integer
'Creates sample of colors, with each row number
'corresponding to that colorindex number
For i = 1 To 56
Cells(i, 1).Interior.ColorIndex = i
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As String
'
Define the range to look at
For Each cell In Range("B2:B20")
x = UCase(cell.Value)
Select Case x
'Follow pattern, inputting names in UPPER case
Case "BOB JONES"
cell.Interior.ColorIndex = 1
cell.Font.ColorIndex = 2
Case "TOM SMITH"
cell.Interior.ColorIndex = 4
cell.Font.ColorIndex = 2
End Select
Next
End Sub
'========
The first macro is simply a reference macro to help you set things up. It
colors the cells in the first column of your sheet, creating a reference
between index number and what the actual color is. The second macro is what
you actually need. The parts you'll need to modify to suit is at the
beginning where you define the range of cells to look at. the second part is
adding additional outcomes, aka "cases" that you want formatting for. I
provided two examples cases to help you get started.
Once your done writing the macro, close the Visual Basic Editor, and you
should be good to go.
--
Best Regards,
Luke M
*Remember to click "yes" if this post helped you!*
"RC@CRA" wrote:
Good morning all. I am using Excel 2003 and I have a worksheet where I need
to apply more than just 3 conditional formats. I have a list of "never
ending" sales and in the far right column I have the salesman's name that
corresponds with the account. I want to be able to highlight the account in a
color that represents the salesman (i.e. Joe = blue, Bob = green, John =
yellow, Matt = pink etc.). The problem is that I have (at least) 7 different
salesman. Is there a way to work around the limit of 3 cond. formats? Can I
write a macro and if so HOW?? (never worked w/macros). Thanks in advance for
your help!
|