Wigi anders moet je even het bestadje van dirktimm even openen.Als je dan de gegevns x en y verandert (de lichtgrijze getallen)dan zie je wat er gebeurt of wat de bedoeling is
Ronny
Ik heb dat gedaan, en ik denk dat deze code dan werkt:
Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, FoundCell As Range
If Target.Address = "$E$3" Or Not Intersect(Target, Range("E5:J6")) Is Nothing Then
On Error Resume Next
Set FoundCell = Sheets("tabel2").Range("B3:B27").Find(what:=Target, lookat:=xlWhole)
If Err.Number <> 0 Then
Exit Sub
Else
Range("E8,G8,I8").Calculate
For Each rng In Range("E8,G8,I8")
If WorksheetFunction.CountIf(FoundCell.Offset(, 1).Resize(, 4), "<=" & Replace(rng.Value, ",", ".")) = 0 Then
rng.Interior.ColorIndex = xlNone
Else
rng.Interior.ColorIndex = FoundCell.Offset(, WorksheetFunction.CountIf(FoundCell.Offset(, 1).Resize(, 4), "<=" & _
Replace(rng.Value, ",", "."))).Interior.ColorIndex
End If
Next
End If
End If
Application.EnableEvents = True
End Sub
Test het en rapporteer!
Wigi