I have this code:
currName = "string" 'unused
cellNum = [VLOOKUP("string", '2012'!A:M, 13, FALSE)]
But I need to replace "string"
with a variable in the VBA code named currName
. I tried this:
currName = "string" 'used
cellNum = [VLOOKUP(currName, '2012'!A:M, 13, FALSE)]
What's the appropriate syntax? When I try the 2nd part with using the variable the issue I'm getting is it's returning invalid data (like if I input it back into a cell, it's #NAME?
). currName
is simply equal "string". It works fine in the first example without the variable being used.