nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I am running a loop, where i go down a list of part numbers, and i need to check each number against a variable list, and if they are in there, it returns yes, and if not, returns a no.
How can i search that list in the array?
VBA Code:
Sheets("77 surplus").Select
Dim arr As Variant
arr = Range("I2:I122")
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To finalrow
Cells(i, 1).Value = partNumber
'**if partNumber variable exists in the list of numbers in arr then**
'cells(i,4).value = "Y"
'else
'cells(i,4).value = "N"
'End If
Next i
How can i search that list in the array?