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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
"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..
 
Upvote 0
[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).
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,686
Members
449,048
Latest member
81jamesacct

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
Back
Top