Excel vba - convert string to number

user960358 picture user960358 · Sep 30, 2011 · Viewed 151.1k times · Source

So, I used the left function to take the first 4 characters of a string and I need to run a vlookup with it, but it won't find the match because it's looking through numbers.

I want to do this in a macro, so I'm not sure about the syntax. Can someone help?

Answer

malificent picture malificent · Sep 30, 2011

use the val() function