Hi all,
I was helped in the past with the script below, but I am having trouble altering it to work for another task. Essentially I want everytime strings with the phrase, "positive Match" and "2_Not List" appear in consecutive cells, I want to return the Record ID.
For the sample data attached the results would end up in A1 of the same sheet as
123456789
01234567
Set ws1 = Sheets("Sheet1Sample Data.xlsx")
Dim RID As String
Dim X As Integer
X = 1
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For Each c In Range("A1:A" & LastRow)
If InStr(1, c.Value, "RecordID") > 0 Then
RID = c.Value
For Each Y In Range("A" & (c.Row + 1) & ":A" & LastRow)
If InStr(1, Y.Value, "Positive Match") > 0 Then
Cells(X, 2).Value = RID
X = X + 1
Exit For
End If
If InStr(1, Y.Value, "RecordID") > 0 Then
Exit For
End If
Next
End If
Next
Columns(1).Delete
Thank you in advance!
Bookmarks