VBA Code much slower in one workbook compared to another

swayp11

Board Regular
Joined
Apr 27, 2009
Messages
107
Office Version
  1. 365
Platform
  1. Windows
I wrote a VBA macro to manipulate some data in a tab with a module in my Personal Workbook. Everything works great and fast.

Now I'd like distribute this to my team, so I do my normal steps:
  1. Create a macro-enabled workbook. This is completely empty.
  2. Add a module.
  3. Paste the exact code from my personal workbook to the module in the macro-enabled workbook.
  4. Add a button that ties to the module. Now the workbook is complete empty except for the button.
  5. Paste the data into the tab with the button (the same exact data I was using when running the code from my personal workbook).
  6. Click the button.

The code when clicking the button is WAY slower. Like 10x slower. What would be the cause of that? I tried moving the code to the actual sheet or thisworkbook, same result. I've added in screenupdating and calculation code, though this shouldn't matter since it's the same exact code as I was using in the personal workbook.


Any ideas?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Posting the code might encourage some responses...

Cheers,

tonyyy
 
Upvote 0
Posting some small relevant sample dummy data to test on would also be useful.
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,358
Members
449,155
Latest member
ravioli44

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