Code Speed

Flavoursavor

New Member
Joined
Feb 18, 2009
Messages
7
Hello Everyone,

This may be a pretty simple answer, but I figured I would ask the experts.

I have 7 modulethat each perform an ODBC query on an AS400 database, then return and perform a regex to delete the unnecessary code.

Each of the macros places the data on a seperate sheet, and then I have another module that works through each sheet and formats. ie headers and the such.

My question is, would my code work faster if i had it all within one module, and call each of the subroutines, or to leave it within seperate modules.

Will i achieve any performance enhancements either way?

Thanks
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
IMHO your suggestion would not improve perfomance.

Try turning off calculation and screenupdating first. This usually makes a dramatic difference.

The ODBC query might be a main problem due to variance in server usage/speed. Could try running when everyone has gone home.
 

Flavoursavor

New Member
Joined
Feb 18, 2009
Messages
7
Hi Brian,

Thanks for the advice.

I ended up changing the way that the query performs by keeping an open ODBC connection and looping through each of the queries, then going back and performing all of the formatting.

Thanks again!
 

Forum statistics

Threads
1,144,376
Messages
5,724,001
Members
422,530
Latest member
Badpoisondwarf

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
Top