Skip to content

Instantly share code, notes, and snippets.

@Se7enSquared
Created June 7, 2021 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Se7enSquared/2209398251188b7b75988f5ffbc248d1 to your computer and use it in GitHub Desktop.
Save Se7enSquared/2209398251188b7b75988f5ffbc248d1 to your computer and use it in GitHub Desktop.
Function ValueInTable(ByVal column_number As Long, ByVal tbl As ListObject, ByVal LookupValue As String) As Boolean
Dim FoundCell As Range
'Attempt to find value in Table's first Column
On Error Resume Next
Set FoundCell = tbl.DataBodyRange.Columns(column_number).Find(LookupValue, LookAt:=xlWhole)
On Error GoTo 0
'Return Table Row number if value is found
If Not FoundCell Is Nothing Then
ValueInTable = True
Else
ValueInTable = False
End If
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment