Ik zit met het volgende probleem. Ik wil graag een kleur automatisch aan een klasse toekennen in VBA. Nu is alleen het probleem dat VBA hem niet ziet.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
Select Case .Value
Case Is = "<20"
.Interior.ColorIndex = 5
Case Is = "<70"
.Interior.ColorIndex = 1
Case Is = "<200"
.Interior.ColorIndex = 6
Case Is = "<400"
.Interior.ColorIndex = 45
Case Is = "<4000"
.Interior.ColorIndex = 3
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
End Sub
Wat gaat er hier fout?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
Select Case .Value
Case Is = "<20"
.Interior.ColorIndex = 5
Case Is = "<70"
.Interior.ColorIndex = 1
Case Is = "<200"
.Interior.ColorIndex = 6
Case Is = "<400"
.Interior.ColorIndex = 45
Case Is = "<4000"
.Interior.ColorIndex = 3
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
End Sub
Wat gaat er hier fout?
