Unanswered: Using VBA to parse delimited values from a single cell and store in string variable?
I have a cell (B2) that may contain 1 or more values separated by a comma (example: 1,2,3). I am storing the value of this cell in a VBA string variable (myVar) and passing to a SQL statement:
SELECT * FROM myTable WHERE mailing IN(myVar)
mailing is a string value in the DB so in order for the IN() to work, each comma separated value must be wrapped in tick marks and store into a new variable ('1','2','3'). I dont need to populate the cell with the transformed results, just store in the variable that is passed to the SQL statement.
i've tried using SPLIT() but that keeps giving me an error, likely b/c of it returning an array.