r/excel•
DAM5150

VBA to convert Vlookups to Index/Match?

solved

Like many others, i'v leaned on the vlookup function for a long time. I have documents and tools i'v created that have thousands of them.

I have since learned of the benefits of the index/match and was wondering if anyone out there had ever put together a little vba script to convert all the vlookups of a document into index matches?

All the information is available it seems, you do you have extrapolate the two different arrays based on the range in the vlookup but this doesn't seem insurmountable.

one i did by hand looks like this: =VLOOKUP(LEFT(A2,6),[Keys.xlsx]Price!$A:$I,9,FALSE) turns into =INDEX([Keys.xlsx]Price!$I:$I,MATCH(LEFT(A2,6),[Keys.xlsx]Price!$A:$A,0))

I could spend days doing this by hand, but it would be lovely if i could just unleash some VBA on it...

Posted Jun 26, 2017, 8:41 PM UTC

1811
Loading comments…