I have a small program that is trying to find a cell containing a certain string and return the Row in the table where it is found.
Here is my program:
Two questions:
1. Both of my commands to find the row return the spreadsheet row and not the table row.
2. If the string is not in the table row, it raises the RunTime Error '91'. What is wrong?
Rich
Here is my program:
Code:
Private Sub test()
'Routine to move data to table from Molding Table
'Check to not overwrite current records but add new ones.
Dim summObj As ListObject
Dim I, X As Integer
Dim foundrow As Integer
' Get the table reference
Set summObj = Worksheets("Summary").ListObjects("SummaryTable")
With summObj
foundrow = .ListColumns("ID").Range.Find("1,3").Row
foundrow = .ListColumns("ID").DataBodyRange.Find("1,3").Row
End With
End Sub
Two questions:
1. Both of my commands to find the row return the spreadsheet row and not the table row.
2. If the string is not in the table row, it raises the RunTime Error '91'. What is wrong?
Rich