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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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