F
F.G.
My apologies I'm newbie on VBA, so don't be frustrated with my
question
I have a sheet with more than 3 CF. I got the Vba code working
corretct. But this works only if I enter the data from the begining,
how do i make it to aplly if the data is already on the sheet.
The code is above:
START OF THE CODE
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As Integer
If Target.Cells.Count > 1 Then Exit Sub
If Target = "" Or Not IsNumeric(Target) Then Exit Sub
CellVal = Target
Set WatchRange = Range("a:k")
If Not Intersect(Target, WatchRange) Is Nothing Then
Select Case CellVal
Case 0 To 3
Target.Interior.ColorIndex = 35
Case 4
Target.Interior.ColorIndex = 33
Case 5
Target.Interior.ColorIndex = 2
Case 6 To 7
Target.Interior.ColorIndex = 44
Case 8 To 10
Target.Interior.ColorIndex = 3
End Select
End If
End Sub
END OF THE CODE
Thank You
Regards,
Frank G
question
I have a sheet with more than 3 CF. I got the Vba code working
corretct. But this works only if I enter the data from the begining,
how do i make it to aplly if the data is already on the sheet.
The code is above:
START OF THE CODE
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As Integer
If Target.Cells.Count > 1 Then Exit Sub
If Target = "" Or Not IsNumeric(Target) Then Exit Sub
CellVal = Target
Set WatchRange = Range("a:k")
If Not Intersect(Target, WatchRange) Is Nothing Then
Select Case CellVal
Case 0 To 3
Target.Interior.ColorIndex = 35
Case 4
Target.Interior.ColorIndex = 33
Case 5
Target.Interior.ColorIndex = 2
Case 6 To 7
Target.Interior.ColorIndex = 44
Case 8 To 10
Target.Interior.ColorIndex = 3
End Select
End If
End Sub
END OF THE CODE
Thank You
Regards,
Frank G