CelestialMind7
New Member
- Joined
- Mar 29, 2019
- Messages
- 13
Hi guys,
I've searched for an answer to my question but don't seem to have any luck since this is somewhat of a unique problem.
I have a very extensive vba program that I've designed for my company. I figured that before I'd start adding even more to it that it would be a good idea to simplify what I've already built by replacing some of the code with what I've read online "should speed up the total vba run. To use one instance for example, I've replaced:
Columns("L:L").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
with
Columns("L:L").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
I've also done this for several copy/paste commands and many other. My problem is - that instead of these one liners speeding up the program, its actually running SLOWER. I've tested a smaller scale run up until the point to which I've made the changes to and original ran in 11:20 seconds and the "improved" code ran in 15:40. That's a huge difference and completely deceives the purpose of these so called "shortcuts". Does anyone have any thoughts as to why this could be happening?
Thanks,
Chris
I've searched for an answer to my question but don't seem to have any luck since this is somewhat of a unique problem.
I have a very extensive vba program that I've designed for my company. I figured that before I'd start adding even more to it that it would be a good idea to simplify what I've already built by replacing some of the code with what I've read online "should speed up the total vba run. To use one instance for example, I've replaced:
Columns("L:L").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
with
Columns("L:L").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
I've also done this for several copy/paste commands and many other. My problem is - that instead of these one liners speeding up the program, its actually running SLOWER. I've tested a smaller scale run up until the point to which I've made the changes to and original ran in 11:20 seconds and the "improved" code ran in 15:40. That's a huge difference and completely deceives the purpose of these so called "shortcuts". Does anyone have any thoughts as to why this could be happening?
Thanks,
Chris