+ Reply to Thread
Results 1 to 5 of 5

Best way to do calculations with large data in VBA

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Best way to do calculations with large data in VBA

    Hi all,

    I'm trying to automate some reports and the data set is pretty large. So far I've been using VBA to create pivot tables and doing the calculations from there. I'm now wondering whether there is a quicker way?

    Using pivot tables is easy but when I have a lot of calculations it does slow down. I was thinking perhaps using arrays and dictionaries to do the calculations but not sure how I would do this? Are there any articles that'll help.

    The calculations are basic eg calculate the count of each item/particular item or sum the cost of a item based on certain conditions etc

    Thanks all!

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Best way to do calculations with large data in VBA

    How many calculations are you actually doing?

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Best way to do calculations with large data in VBA

    Maybe like 5-10 calculations but on a large data set and for a large number of records. So doing it the pivot way has been quite slow changing the report filters for each record

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Best way to do calculations with large data in VBA

    How do 5 array formulas fare?

  5. #5
    Registered User
    Join Date
    06-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Best way to do calculations with large data in VBA

    Would like to have it all done automated via VBA


    Heres an example of what I am doing. I am calculating the costs and time and count for every Priority Group.
    Is the below code an efficient way to do this? I've created 3 dictionaries but Im not sure whether It can be done with just one?

    Another thing I need to do is to count the number of Locations for each Priority Group (each Priority Group may have more than one location so I need to count each one)

    Would it just be easier to use pivot tables with VBA rather than array/dictionaries?

    Thanks


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1