What can I do to enhance the speed of this macro?

yousufj56

Board Regular
Joined
May 22, 2014
Messages
51
Hi,

I have a spreadsheet that has a list of URLs on Sheet2. The macro pulls the JSON data from each URL and then pastes them in a certain order on another sheet. Since the data pull is huge, it keeps freezing when i try to do all 196 URLs at once. But if i do them 50 at a time, it works just fine. It doesn't freeze and is decently fast.

Is there some way i can optimize this so i dont have to manually run them 50 at a time? I was thinking separating the URLs to be pulled by different macros and then maybe a Call Macro1 type thing but that would probably freeze aswell.

I was trying to add the spreadsheet but don't know how to do that on here. So if you need to look at the spreadsheet, please let me know how to upload and will do.

Thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
couple of things to try

DoEvents in the code

or

run the macro as a series of loops

For 1 to 50
Next
For 51 to 100
Next
For 101 to 150
Next
For 151 to 196
Next
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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