Function TextColor(rCell As Range, Optional ColorName As Boolean)
Dim strColor As String, iIndexNum As Integer
Select Case rCell.Interior.ColorIndex
Case 10
strColor = "Green"
iIndexNum = 10
Case 3
strColor = "Red"
iIndexNum = 3
Case Else
strColor = "Other"
End Select
If ColorName = True Or _
strColor = "Other"
Then
TextColor = strColor
Else
TextColor = iIndexNum
End If
End Function