How to color multiple cells

H

humberto

I have a sheet for a soccer tournament with 10 teams that have to play
games each home and away. , this means that each team appears 18 time
in this sheet. How can I color each team (cell) without having to colo
one cell at a time. I will use different colors for each team.
Thanks a million for your help in advance.

P/S, ex:
Column A Column B

USA vs. France France vs. USA
USA vs. Italy Italy Vs. USA
USA vs. Spain Spain vs. US

Attachment filename: premier division.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=46333
 
F

Frank Kabel

Hi
as David posted you'll need VBA for this. Looking at your example the
following may help you to get started. Put this code in your worksheet
module and add the missing teams:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
With Target
If .Column <> 2 And .Column <> 6 And .Column <> 8 _
And .Column <> 12 Then Exit Sub
On Error GoTo CleanUp:
Application.EnableEvents = False
Select Case Target
Case "DUMONT"
.Interior.ColorIndex = 3
Case "HOBOKEN"
.Interior.ColorIndex = 10
Case "ROCKLAND"
.Interior.ColorIndex = 12
'etc
End Select
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Top