I want to check if my data is within an array and if so it should write it in a new cell.
My problem:
If two entries are the same and follow each other my if statement wont find it in the for loop because my loop doesn't reset.
How can I fix this?
Sub Tester()
Dim ArtikelZgm As Variant
ArtikelZgm = Worksheets("Artikel").Range("A1").CurrentRegion
Dim a As Long
For a = LBound(ArtikelZgm, 1) To UBound(ArtikelZgm, 1)
For b = 2 To 100
If ArtikelZgm(a, 3) = Worksheets("Bestellung Lidl").Cells(b, "F").Value Then
Worksheets("Bestellung Lidl").Cells(b, "H").Value = ArtikelZgm(a, 1)
Worksheets("Bestellung Lidl").Cells(b, "I").Value = ArtikelZgm(a, 5)
b = b + 1
End If
Next b
Next a
End Sub