Macro fast when F5 from VBE but 5x slower with form button, activeX button, shortcut key and macro dialogue box, why?

JZG

New Member
Joined
Jun 24, 2020
Messages
7
Office Version
  1. 2010
Platform
  1. Windows
The title says it all. This is not about tips to make my code run faster. I routinely run a "Turn Stuff Off" before and a "Turn Stuff On" after the main code.

The question is: When I run the same code from F5 in the VBE vs All Ways to CALL the code, why are all the other ways 5 times slower?

F5 = 5 sec
vs
form button = 26 sec
activeX = 26 sec
ctrl + sft + Q = 26 sec
selecting macro from the macro dialog box = 26 flipping sec
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
1. post the code for us to look at

2. F5 ??- this simply opens the GoTo dialog box for me
 
Upvote 0
Sorry Yongle but I'm under a strict NDA and can't post the code. Regardless of the code though, is there an overhead issue with using a keyboard shortcut, et al vs. F5 from the VBE. Incidentally, the "Run Sub" play button in the VBE performs the same as F5.
 
Upvote 0
I have never noticed that problem
- but that does not mean that there is not a difference in performance.
I will do some testing and see if I can make it happen. I will update the thread with my observations tomorrow.
 
Upvote 0
many thanks again. I've spent a fair amount of time searching for a thread. Shutting down all other office products and reboots have not changed anything.
 
Upvote 0
Not something I've ever noticed, but are you using two monitors?
 
Upvote 0
That might be the cause, I have seen posts in the past where having the VB editor on one monitor & the sheet on another effects the code.
 
Upvote 0
Fluff, One of the variations I've checked is with the editor open vs closed.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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
Back
Top