I have 500 identical single-sheet workbooks in a folder and would like to
insert a sheet from another workbook into all of them. Is there a way to do
this in a batch w/o have to open each one and copying the sheet? Thanks.
spence
Hi Spence,
If you are familiar with VBA you can write a module to what you are asking.
The DIR function is very useful. You can load an array with all the excel
workbook path names in a given folder i.e.:
MyFile = Dir(MyPath quot;\*.xlsquot;)
' Load an array with all .xls file names found in the given path
aFileArray(1) = MyPath quot;\quot; MyFile
For i = 2 To 500
MyFile = Dir
If MyFile lt;gt; quot;quot; Then
aFileArray(i) = MyPath quot;\quot; MyFile
ElseIf MyFile = quot;quot; Then
Exit For
End If
Next i
Then recursively open each one and paste your worksheet. Regards.
quot;spencequot; wrote:
gt; I have 500 identical single-sheet workbooks in a folder and would like to
gt; insert a sheet from another workbook into all of them. Is there a way to do
gt; this in a batch w/o have to open each one and copying the sheet? Thanks.
gt;
gt; spence
Hi spence
Try this one
www.rondebruin.nl/copy4.htm
--
Regards Ron de Bruin
www.rondebruin.nlquot;spencequot; gt; wrote in message ...
gt;I have 500 identical single-sheet workbooks in a folder and would like to
gt; insert a sheet from another workbook into all of them. Is there a way to do
gt; this in a batch w/o have to open each one and copying the sheet? Thanks.
gt;
gt; spence
- May 27 Tue 2008 20:44
inserting a sheet into multiple workbooks
close
全站熱搜
留言列表
發表留言