MojoJojo2023
New Member
- Joined
- Aug 7, 2023
- Messages
- 9
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
In the below code, I am attempting to find each cell in a given range in a reference data worksheet I have set up. If it does find the cell value within the reference data range, it will return a yes or otherwise return a no. As of right now, I am returning only no for every cell in the range, even though there are matches. Does anyone know a fix that would correct this?:
Sub MatchPB()
Thanks in advance!
Sub MatchPB()
VBA Code:
Dim wb As Workbook
Dim bingo As Range
For Each cell In PB.Range("A2:A104")
With RData.Range("A2:A50")
Set bingo = .Find(What:=cell.Value, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If bingo Is Nothing Then
cell.Offset(0, 27).Value = "Yes"
Else: cell.Offset(0, 27).Value = "No"
End If
End With
Next
End Sub
Thanks in advance!