I have several sheets containing ListObjects
When I have to look for corresponding values in a listbject what I do is the following:
dim mytable as Listobject
set mytable = thisworkbook.sheets(x).listobject(1)
ValuetoSearch="whatever"
valueResult=""
' looking for the corresponding value of column A in column B
for i=1 to mytable.listrows.count
if mytable.listcolumns("A").databodyrange.item(i).value=ValuetoSearch then
valueResult=mytable.listcolumns("B").databodyrange.item(i).value
exit for
end if
next i
That works. fine. but:
Its that the FASTEST way to do the search? I am using several of those lookup operations "on the fly" when the user select certain cells in the sheet (with workbook change select) and it comes a point when "you feel it" there is this almost a second delay that starts to be annoying for the user.
cheers thanks