General VBA question

phor89

New Member
Joined
Jan 4, 2019
Messages
3
I am an intermediate/advanced user of Excel but have never tried to learn VBA. All the work I do is very calculation and chart heavy, working with time-series and statistics etc.

A typical worksheet might include several columns of price data, from which there are several other columns of formulas deriving further values from those original prices. Formulas are often logic based e.g. IF, LOOKUPS, INDEX, MATCH and calculation based e.g. AVERAGE, SUMIF etc...

Obviously with tens or even hundreds of thousands of these cells, calculations can take a long time. My question is, would using VBA speed up the calculation time? E.g. coding the same calculations through VBA to output the same values in the same cells?

Please correct me if I am barking up the wrong tree here. Perhaps there are other ways to speed up the calculations, or I am missing the point of using VBA entirely.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

sykes

Well-known Member
Joined
May 1, 2002
Messages
1,785
Office Version
  1. 365
Platform
  1. Windows
Hi
I'm not a VBA guru, by any means, and hopefully, some of the other Top Neddies will give you their thoughts on this, but...

I find that by using VBA, you have a lot more flexibility over what you can do with your data, rather than by using fairly fixed formulae. For example, when you run some code, you can be selective over which cells, upon which worksheets, calculations are made, so - in your case- being selective about calculations, COULD save quite a bit of time.
Also, with code, you can temporarily switch calculation mode off, then on again - meaning that tasks can be carried out without the processor and/or memory getting bogged down with unnecessary calculations.
By the same token, you can also temporarily switch off screen updating - once again, saving machine time, and with it, allowing more machine time for making your calculations, rather than unnecessarily displaying a lot of changes to the user.

I'm guessing that it would definitely be worth a trial, at least - to test a coded approach versus a formulae-based one, on perhaps just part of your data - to see how you get on with it.
I'll bet that once you use code, you'll see some real benefits - and not just with regard to speed...
 

Watch MrExcel Video

Forum statistics

Threads
1,129,463
Messages
5,636,427
Members
416,918
Latest member
twc2c

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top