Loop a Vlookup

AndyD

Active Member
Joined
Nov 14, 2002
Messages
449
Hi
i use the following type index in a spreadsheet and copy it down several thousand cells

=index(range_1,match(A2,range_2,0),2))

would it be more efficient if i did something like this in VBA? (if so, if someone could supply code would be great...

eg something along lines of

Cells(i,1)=vlookup formula (using "false", so always finds a match)
next i

etc, etc

any solutions (or ideas) welcomed...
cheers all
Andy
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
"would it be more efficient if i did something like this in VBA? "

unlikely - built in functions invariably exute faster than anything you have to compile, among other reasons.

what, exactly, are you trying to do & what problems are you trying to overcome..
 

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
[built in functions invariably exute faster ]

I agree, but with a macro we can put something in the statusbar to show progress (eg. row number) when a long re-calc is required - which does show that Excel has not crashed. This is almost as good as the Cup of Coffee method (grin).
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,956
Messages
5,856,507
Members
431,819
Latest member
hellosunshine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top