![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
I have a workbook that has the salepeoples names in row r. I would like the whole row reflect a color based on that column. I want to assign each sales person a different colr (there are 4 right now). The column rows are a - r. I can do a conditional format for the cells in column r but would like the whole row. Any ideas?
[ This Message was edited by: rickp on 2002-05-09 11:20 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
I was hoping maybe a VB that would take care of the 4 sales people or maybe be able to handle more.
|
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
[ This Message was edited by: Mark W. on 2002-05-09 11:11 ] |
|
|
|
|
|
|
#5 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
What cell is in the input, R_ ?
What are the inputs (names)? What are the colors respecitve colours? This can be done via worksheet_change. We'll be waiting. _________________ Cheers, NateO ![]() [ This Message was edited by: NateO on 2002-05-09 11:35 ] |
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
It starts at cell R5 ends R184, the names are susan , brian , tracy , jason .. the colors are blue , green , pink , purple .
|
|
|
|
|
|
#7 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Almost there, you want:
R5 ends R184 highlighted based on which single cell that changes. Or is it r5:ar5, r6:ar6, etc....Still which cell is the decision maker? |
|
|
|
|
|
#8 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Column R is the decision maker ... it starts at row 5
|
|
|
|
|
|
#9 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Right-click on the sheet in question, click 'view code' and paste the following procedure:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [r5:r184]) Is Nothing Then
If Target.Value = "Susan" Or Target.Value = "susan" Then
Target.EntireRow.Interior.ColorIndex = 5
ElseIf Target.Value = "Brian" Or Target.Value = "brian" Then
Target.EntireRow.Interior.ColorIndex = 4
ElseIf Target.Value = "Tracy" Or Target.Value = "tracy" Then
Target.EntireRow.Interior.ColorIndex = 7
ElseIf Target.Value = "Jason" Or Target.Value = "jason" Then
Target.EntireRow.Interior.ColorIndex = 21
Else: Target.EntireRow.Interior.ColorIndex = xlNone
End If
End If
End Sub
Hope this helps. |
|
|
|
|
|
#10 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Works like charm ... Yes I did change jason color to 6
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|