Typen unverträglich
27.02.2018 15:02:07
Alina
Ich bekomme in Vba die Fehlermeldung, dass meine Typen unverträglich sind, wenn ich sie mit dem heutigen Datum vergleiche.
Habe ich in meinem Code einen Fehler: (fett)
If Not IsEmpty(ws1.Cells(j + 1, 10)) Then
If Not IsEmpty(ws1.Cells(j + 1, 11)) Then
If IsDate(ws1.Cells(j + 1, 11).Text) Then
ws3.Cells(j, i).FormulaR1C1 = "=-days('Rtx Befüllung'!R" & (j + 1) & "C10,'Rtx Befüllung'!R" & (j + 1) & "C11)"
Call TerminFar(ws3.Cells(j, i), ws3.Cells(j, i).Text)
Else
ws3.Cells(j, i).Value = ""
Range(Cells(j, i), Cells(j, i)).Interior.ColoorIndex = xlNone
End If
ElseIf IsEmpty(ws1.Cells(j + 1, 11)) Then
If heute - ws1.Cells(j + 1, 10).Value ws3.Cells(j, i).Interior.Color = RGB(255, 236, 139) 'bei bis zu zehn tagen zu spät gelb
ElseIf heute - ws1.Cells(j + 1, 10).Value > 10 Then
ws3.Cells(j, i).Interior.Color = RGB(255, 69, 0) 'ab elf tagen verzögerung rot
Else
ws3.Cells(j, i).Value = ""
Range(Cells(j, i), Cells(j, i)).Interior.ColoorIndex = xlNone
End If
End If
End If
habt ihr eine Idee, wie ich die Typen gleich machen könnte?
ws1.Cells(j + 1, 10) habe ich schon als Datum in Excel eingestellt
Danke!