LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Opinions Wanted - Which is Faster???

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Wanted Shiblie Bshara Excel Worksheet Functions 1 May 1st 08 01:05 PM
Can faster CPU+larger/faster RAM significantly speed up recalulati jmk_li Excel Discussion (Misc queries) 2 September 28th 05 10:24 AM
Just wanted to say thanks! comotoman Excel Discussion (Misc queries) 0 September 20th 05 03:45 PM
Need Your Opinions - No Work here, just let me know what you think ! BenjieLop Excel Discussion (Misc queries) 0 February 18th 05 06:25 PM
your opinions and help on my best sub thus far ksnapp[_49_] Excel Programming 5 April 8th 04 11:35 PM


All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"