Looping Over Workbooks

jkizer

New Member
Joined
Aug 19, 2008
Messages
5
Hi all,

I was wondering what the forum's thoughts were on the most efficient way to loop over a large set of workbooks where ordering matters (i.e., possibly you need to copy data from workbookx, then workbooky and then workbookz in exactly that order and pasting all this data to a single workbook) and where the data in the workbooks may be so large that you would prefer (or might even be unable) to have all the workbooks open at the same time.

In the past I have dealt with the first issue by using the workbooks(i) format and opening the workbooks in such a way that the ordering was correct. I then looped over these workbooks using a do while loop. So any thoughts on better methods would be appreciated.

I have never dealt w/ the second issue though. I have just wondered how one would accomplish this efficiently. In particular whether there was any way to loop over a large number of closed workbooks w/o having to specify each workbook's exact name i.e., "c:/book1.xls", "c:/book2.xls" and so on.

Thanks,

JK
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,215,221
Messages
6,123,701
Members
449,117
Latest member
Aaagu

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