View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
FredrikLyhagen FredrikLyhagen is offline
external usenet poster
 
Posts: 2
Default Update sheet after changed Interior.ColorIndex

Function FillColor(Cell As Range) As String
Dim C As Long
C = Cell.Interior.ColorIndex
If C = 1 Then
FillColor = "Black"
ElseIf C = 9 Then
FillColor = "Dark Red"
ElseIf C = 3 Then
FillColor = "Red"
ElseIf C = 7 Then
FillColor = "Pink"
ElseIf C = 38 Then
FillColor = "Rose"
ElseIf C = 53 Then
FillColor = "Brown"
ElseIf C = 46 Then
FillColor = "Orange"
ElseIf C = 45 Then
FillColor = "Light Orange"
ElseIf C = 44 Then
FillColor = "Gold"
ElseIf C = 40 Then
FillColor = "Tan"
ElseIf C = 52 Then
FillColor = "Olive Green"
ElseIf C = 12 Then
FillColor = "Dark Yellow"
ElseIf C = 43 Then
FillColor = "Lime"
ElseIf C = 6 Then
FillColor = "Yellow"
ElseIf C = 36 Then
FillColor = "Light Yellow"
ElseIf C = 51 Then
FillColor = "Dark Green"
ElseIf C = 10 Then
FillColor = "Green"
ElseIf C = 50 Then
FillColor = "Sea Green"
ElseIf C = 4 Then
FillColor = "Bright Green"
ElseIf C = 35 Then
FillColor = "Light Green"
ElseIf C = 49 Then
FillColor = "Dark Teal"
ElseIf C = 14 Then
FillColor = "Teal"
ElseIf C = 42 Then
FillColor = "Aqua"
ElseIf C = 8 Then
FillColor = "Turquoise"
ElseIf C = 34 Then
FillColor = "Light Turquoise"
ElseIf C = 11 Then
FillColor = "Dark Blue"
ElseIf C = 5 Then
FillColor = "Blue"
ElseIf C = 41 Then
FillColor = "Light Blue"
ElseIf C = 33 Then
FillColor = "Sky Blue"
ElseIf C = 37 Then
FillColor = "Pale Blue"
ElseIf C = 55 Then
FillColor = "Indigo"
ElseIf C = 47 Then
FillColor = "Blue Gray"
ElseIf C = 13 Then
FillColor = "Violet"
ElseIf C = 54 Then
FillColor = "Plum"
ElseIf C = 39 Then
FillColor = "Lavender"
ElseIf C = 56 Then
FillColor = "Grey-80%"
ElseIf C = 16 Then
FillColor = "Grey-50%"
ElseIf C = 48 Then
FillColor = "Grey-40%"
ElseIf C = 15 Then
FillColor = "Grey-25%"
ElseIf C = 2 Then
FillColor = "White"
Else
FillColor = "NonStnd"
End If
Application.Calculate
End Function