ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using a variable name as part of a file pathname to open many files (https://www.excelbanter.com/excel-programming/285184-using-variable-name-part-file-pathname-open-many-files.html)

trickydick

Using a variable name as part of a file pathname to open many files
 
I need to open 76 Excel files one at a time and copy the data on a ta
to a rollup workbook with 76 tabs. Is there a way to build an arra
with the names of the 76 workbooks and then change the pathname usin
the 76 names in the array so I can open each workbook, copy th
information to the rollup workbook, and close the individual workbooks
The workbooks are too large to open all of them and then copy the dat
to the rollup workbook!

TIA!!:

--
Message posted from http://www.ExcelForum.com


keith

Using a variable name as part of a file pathname to open many files
 
Yes this can be done,

use a string variable for the name of the
workbooks.open Filename:=strFileName
''where strFileName is a path and file name of the file
you want to open, then use the activeworkbook and
thisworkbook object to play around with the workbooks and
data.

Keith
www.kjtfs.com

-----Original Message-----
I need to open 76 Excel files one at a time and copy the

data on a tab
to a rollup workbook with 76 tabs. Is there a way to

build an array
with the names of the 76 workbooks and then change the

pathname using
the 76 names in the array so I can open each workbook,

copy the
information to the rollup workbook, and close the

individual workbooks?
The workbooks are too large to open all of them and then

copy the data
to the rollup workbook!

TIA!!:)


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 05:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com