I have a macro with the first snippet of code that runs fine, however when I tried to adapt this functioning code to a new workbook that uses a Table to hold the same data (second code snippet), I get a run-time error 438. Can anyone tell me what is wrong with my syntax?
Thanks.
Thanks.
VBA Code:
With Range("CustomerName")
Set c = .Find(What:=Customer, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
CustRow = c.Row
End With
VBA Code:
With Sheets("Customers").ListObjects("TableCustomerDetails").ListColumns(1)
Set c = .Find(What:=Customer, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
CustRow = c.Row
End With