Selasa, 30 Agustus 2011

[ExcelVBA] Re: Relative Speed: Find vs VLookup

 

Thanks all. When you have a hammer, everything looks like a nail. I just spent considerable effort learning a little VBA, so when I was faced with this problem, I immediately started coding. But I tried DavidB's statement, and it is amazingly fast.

Incidentally, the addition of a 4th argument to VLOOKUP, and the fact that the table doesn't have to be sorted is (relatively) recent. I used "Running Excel 5" as my reference, and it shows only 3 arguments and says the table must be sorted. These changes to VLOOKUP are very useful.

Thanks again,
Michael Trombetta

--- In ExcelVBA@yahoogroups.com, "david braithwaite" <dbraithwaite@...> wrote:
>
> Hi
>
>
>
> Agree with DaveS that you might as well do it on the sheet with formulas
> rather than VBA.
>
>
>
> I dummied up your 40,000 on sheet1 one and 60,000 on sheet2 and copied down
> the formula in C1
>
> =INDEX(Sheet2!$A$1:$B$60000,VLOOKUP(A1,Sheet2!$A$1:$A$60000,1,FALSE),2)
>
> and it was nearly immediate.
>
>
>
> Db
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE
A bad score is 579. A good idea is checking yours at freecreditscore.com.
.

__,_._,___

Tidak ada komentar:

Posting Komentar