Hi to all
I've been searching for colorfuntion or colorfont in this site and Google for my likeness but have not luck.
I have to create a spreadsheet for others who dont know much about Excel.
Numbers in E column is to change color if B column in same row turn yellow.
There are number 1 to 5 in E column
Like number 5 in Column E turn blue if cell in B column in same row turn yellow
and number 4 in Column E turn green and number 3 in Column E turn pink and so on.
I tried this code but have no luck
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Long
Sheets("Sheet1").Activate
For i = 5 To 26
If Range("E" & i).Value = "5" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
Range("E" & i).Interior.ColorIndex = 5
End If
If Range("E" & i).Value = "4" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
Range("E" & i).Interior.ColorIndex = 10
End If
If Range("E" & i).Value = "3" & Range("B" & i).Value = Interior.ColorIndex = 6 Then
Range("E" & i).Interior.ColorIndex = 7
End If
Next i
End Sub
I attached sample book for you to see
NumberChangeColor2.xlsm
Bookmarks