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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation Speeds

Status
Not open for further replies.

ribhead

Technical User
Jun 2, 2003
384
US
I'm relatively new with VBA and I am wanting to speed up the time it takes for my computer to save the program. I realize that the system on which it is running will make a big difference but I still am trying to speed up the process. Enough of me rambling here is the question: If I eliminate lines of code that are strictly for doing calculations and instead, insert a formula in the cell itself to let Excel calculate the number. What are my gains/losses?

I may not be very smart but I'm sure wirey!!!!
 
99% of time, excel will calc faster than VBA will - as long as the formulae are native to excel (ie not UDF's or Array kludges). You must also remember that it will depend on how many formulae you have in the workbook. If the calc tree is large, then it will recalc all your formulae and you probably won't gain any time. If, however, your calc tree is relatively small, you should be able to gain (a bit) from this method. However, I wouldn't've thought that time gains would be significant from there - most time gains can be obtained by making sure calc is set to manual and doing a recalc at the end / not using loops unless necessary and not using SELECT or ACTIVATE in your code as much as possible

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top