Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSUM VBA equivalent?

Status
Not open for further replies.

CH99

Technical User
Feb 6, 2003
3
US
I was using excel's =DSUM database function to lookup multiple occurrences of a transaction number and sum an amount located in another column each time the transaction number was found. Though this procedure worked great when the worksheets contained only a few hundred lines, my spreadsheet is now 45 MB and contains sheets with several thousand lines. Due to the nature of excel's DSUM function whereby the in order to get subsequent lines to have only the total for that line, you need to "sum" all the lines including that line and then subtract all the lines leading up to that line. This produces a tremendous amount of overhead - my spreadsheet has now been "calculating" for over 3 hours, and has yet to finish. I know that this is caused by the way the formula is written.

Does anyone have any VBA scripts that can do the same thing in a much more effecient manner?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top