Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Everyone,
Using VBA I need to loop through a lot of records, pick up an account name, find the account name in a big table and return the account balance. In terms of speed which is quicker, option 1 or 2: Option 1 : Vlookup myBalance = Application.WorksheetFunction.VLookup(myAccount, myBigTable, iBalanceColumn, False) Option 2 : Loop through the big table dim r as range For Each r in myBigTable If r.Cells(1, iAccountColumn) = myAccount then myBalance = r.Cells(1, iBalanceColumn) Exit For End if Next I had heard that using WorksheetFunctions in VBA was quite slow. What do you think? Or is there an alternative even quicker way to do this??? TIA big t |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help Wanted | Excel Worksheet Functions | |||
Can faster CPU+larger/faster RAM significantly speed up recalulati | Excel Discussion (Misc queries) | |||
Just wanted to say thanks! | Excel Discussion (Misc queries) | |||
Need Your Opinions - No Work here, just let me know what you think ! | Excel Discussion (Misc queries) | |||
your opinions and help on my best sub thus far | Excel Programming |