• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

32 bit Excel on 64 bit CPU utilization?

pete6032

Diamond Member
I have a macro that does loop calculations using multiple combinations of formula inputs. I have 32 bit Excel 2010 on a 64 bit CPU. The macro takes about 30 mintues to run. I opened up task manager and the CPU utilization is staying around 32-35% with 200 MB of RAM used. Seems like the macro could use more CPU and complete faster. Is it not using more CPU because it is 32 bit Excel?
 
I found the issue. The macro is written in vba, which appears to only run on one thread.
I used to write VBA code for a living if you want some advice and are willing to share the code. I've never seen code run 30min or more that wasn't correctly optimized.

Sometimes quick wins can be had just by adding:
Code:
Application.ScreenUpdating = False 'Before code executes
Application.EnableEvents = False 'Only use this if you know your code doesn't rely on events (there is a problem if it does typically!!!)

Application.ScreenUpdating = True 'At the end, after all code
Application.EnableEvents = True 'Only needed if you used = False earlier

Just a comment on the above, while this may improve your performance, there is typically a number of more things that can be done if this is helping you.
 
I used to write VBA code for a living if you want some advice and are willing to share the code. I've never seen code run 30min or more that wasn't correctly optimized.

Sometimes quick wins can be had just by adding:
Code:
Application.ScreenUpdating = False 'Before code executes
Application.EnableEvents = False 'Only use this if you know your code doesn't rely on events (there is a problem if it does typically!!!)

Application.ScreenUpdating = True 'At the end, after all code
Application.EnableEvents = True 'Only needed if you used = False earlier

Just a comment on the above, while this may improve your performance, there is typically a number of more things that can be done if this is helping you.
Thanks for this post. I don't know much about VBA but I did some Google searching and ended up putting this into the code and now it runs substantially faster, much appreciated!
 
Back
Top