Hi,
I have tried for hours to get a VLookup call in a macro to work. I am not experience VBA programmer, but I am very experienced in C++. Even a hard coded argument function does not work. I get various errors like 1004, 2015, etc
Attached is a simple test worksheet that is labeled and has the code.
The problem I want to solve is to take a delimited list as a string (e.g. "a,b,c,d") and extract each delimited item and use it to lookup in a table , then construct a delimited list of the looked up values. So If I had a table like a,1 b,2 c,3 d,4 then a,b,c,d would turn into 1,2,3,4
The list can be an arbitrary length.
The code supplied breaks the problem down into counting the terms (which works), Extract each term by an index with 1 being the first term (also works). The final step is to put the extract term into vlookup with the rest of the arguments (the table range, the column number and range lookup boolean) simply passed by the caller. The test spreadsheet show everything working in the spreadsheet (hard coded in terms of using the term values in vlookup). In the macro however, it just does not work. I am chalking it up to my inexperience with VBA. I appreciate the help.
The macro is under Module
Bookmarks