TheRedCardinal
Board Regular
- Joined
- Jul 11, 2019
- Messages
- 243
- Office Version
- 365
- 2021
- Platform
- Windows
I have a function (taken from here) to determine if a value appears in an array.
The value I'm looking for is the last entry in an array, in box 6.
I have coded as follows:
The first line is because the table is blank and so I wanted to skip if this is the case.
My function looks like this:
I get an Object required error at the "If IsInArray" line.
Which obvious error have I made?
Thanks,!
The value I'm looking for is the last entry in an array, in box 6.
I have coded as follows:
VBA Code:
If ExportArray(UBound(ExportArray), 6) <> "" Then
If IsInArray(ExportArray(UBound(ExportArray), 6).Value, CustomerData) = False Then
MsgBox ("Customer Not Found")
Else
MsgBox ("Customer Found")
End If
End If
The first line is because the table is blank and so I wanted to skip if this is the case.
My function looks like this:
VBA Code:
Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
IsInArray = Not IsError(Application.Match(stringToBeFound, arr, 0))
End Function
I get an Object required error at the "If IsInArray" line.
Which obvious error have I made?
Thanks,!