VBA - Frage zu Instr
16.03.2026 15:39:42
Christian
' --------------------------
' 6c. Neue Einträge nach Codes übertragen
' --------------------------
lastRowCodes2 = wsCodes2.Cells(wsCodes2.Rows.Count, "A").End(xlUp).Row
If wsCodes2.Cells(1, "A").Value = "" Then
startRowCodes = 1
Else
startRowCodes = lastRowCodes2 + 1
End If
counter = 0
For i = 1 To neueIdx
txtA = arrNeueEintraege(i, 1)
txtB = arrNeueEintraege(i, 2)
txtD = arrNeueEintraege(i, 4)
If txtD = "" Then GoTo NextRowCodes
If txtB > "" Then
If InStr(1, txtB, "UNKNOWN", vbTextCompare) > 0 Or _
InStr(1, txtB, "UNKNOWNS", vbTextCompare) > 0 Then GoTo NextRowCodes
End If
If txtA > "" And txtB > "" Then
If InStr(1, txtA, txtB, vbTextCompare) > 0 Then GoTo NextRowCodes
End If
counter = counter + 1
wsCodes2.Cells(startRowCodes + counter - 1, "A").Value = txtA
wsCodes2.Cells(startRowCodes + counter - 1, "B").Value = txtB
wsCodes2.Cells(startRowCodes + counter - 1, "M").Value = txtD
wsCodes2.Cells(startRowCodes + counter - 1, "C").Value = "site:www.imdb.com/title " & txtA & " " & txtB
wsCodes2.Cells(startRowCodes + counter - 1, "L").Value = "date of birth " & txtB
NextRowCodes:
Next i
eigentlich hätte mein Wunsch heißen sollen, es sollen keine Zeilen übertragen werden, in denen in Spalte B UNKNOWN oder UNKNOWNS steht, sowie Zeilen in denen der Text in Spalte A den Text in Spalte B enthält.
Jedoch prüft dieses Makro auch umgekehrt, ob der Text in Spalte B den Text in Spalte A enthält. Wie kann ich diese letzte Prüfung umgehen, sodass diese Zeilen übertragen werden?
Danke
Christian
Anzeige