i have a macro running, who check the values in Column 5 and 4.
The Checking should be expand for one more check, if the results of the check from Column 5 and 4 is also positiv, there should be a check if the date value of the Column 6 is also available in the table tbl_Termine.
If this parameter is also positiv, there should be the Value "bei Termin entfernt" in the Cell of Column 7.
Sub ErgebnisEintragen()
For i = 2 To 13
If Cells(i, 5).Value > 0 And Cells(i, 4).Value = 0 Then
Cells(i, 7).Value = "entfernt"
End If
Next
End Sub
I hope you can understand my Question, and also you can help me!
Thanks a lot
Ă–.
i dont know what i have to change, but the code until now is working.
>Solution :
Sub ErgebnisEintragen()
Const TABLE_NAME = "tbl_Termine"
Dim i As Long, c As Range
For i = 2 To 13
If Cells(i, 5).Value > 0 And Cells(i, 4).Value = 0 Then
Set c = Range(TABLE_NAME).Find(Cells(i, 6).Value, , xlValues, xlWhole)
If Not c Is Nothing Then Cells(i, 7).Value = "entfernt"
End If
Next
End Sub
OR
Sub ErgebnisEintragen()
Const TABLE_NAME = "tbl_Termine"
Dim arr, i As Long, c As Range
Set c = Range(TABLE_NAME)
For i = 2 To 13
If Cells(i, 5).Value > 0 And Cells(i, 4).Value = 0 Then
If Not VBA.IsError(Application.Match(Cells(i, 6), c, 0)) Then
Cells(i, 7).Value = "entfernt"
End If
End If
Next
End Sub
