ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy sheet from multiple files (https://www.excelbanter.com/excel-programming/344225-copy-sheet-multiple-files.html)

Steph[_7_]

Copy sheet from multiple files
 
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy the
sheet from each of the selected files into a single file. So for example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!



Barb Reinhardt

Copy sheet from multiple files
 
Is this what you are looking for?

http://www.rondebruin.nl/copy3.htm#sheet


"Steph" wrote in message
...
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy the
sheet from each of the selected files into a single file. So for example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!





Steph[_7_]

Copy sheet from multiple files
 
Close. That will give me all files...The folder I am eccessing has hundreds
of files. I need 20 or so. So I would like to incorporate the multi-select
into that, and that would be perfect!

"Barb Reinhardt" wrote in message
...
Is this what you are looking for?

http://www.rondebruin.nl/copy3.htm#sheet


"Steph" wrote in message
...
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy the
sheet from each of the selected files into a single file. So for

example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!







Tom Ogilvy

Copy sheet from multiple files
 
Basic code would be:

Dim v as Variant, i as Long, bk as workbook
v = Application.GetOpenFilename( Multiselect:=True)
if not isarray(v) then exit sub
for i = lbound(v) to ubound(v)
set bk = Workbooks.Open(v(i))
bk.Worksheets(1).Copy After:=ThisWorkBook.Sheets( _
ThisWorkbook.Sheets.count)
bk.Close SaveChanges:=False
Next

--
Regards,
Tom Ogilvy



"Steph" wrote in message
...
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy the
sheet from each of the selected files into a single file. So for example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!





Barb Reinhardt

Copy sheet from multiple files
 
I had to do something not long ago where I had a list of the path name and
the file name in an Excel workbook and needed to get other info out of the
document. This was the thread with the question and answers. It may help
you.
http://www.microsoft.com/office/comm...4-0666e4f15155


"Steph" wrote in message
...
Close. That will give me all files...The folder I am eccessing has
hundreds
of files. I need 20 or so. So I would like to incorporate the
multi-select
into that, and that would be perfect!

"Barb Reinhardt" wrote in message
...
Is this what you are looking for?

http://www.rondebruin.nl/copy3.htm#sheet


"Steph" wrote in message
...
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy
the
sheet from each of the selected files into a single file. So for

example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!









Steph[_7_]

Copy sheet from multiple files
 
Thank you!

"Tom Ogilvy" wrote in message
...
Basic code would be:

Dim v as Variant, i as Long, bk as workbook
v = Application.GetOpenFilename( Multiselect:=True)
if not isarray(v) then exit sub
for i = lbound(v) to ubound(v)
set bk = Workbooks.Open(v(i))
bk.Worksheets(1).Copy After:=ThisWorkBook.Sheets( _
ThisWorkbook.Sheets.count)
bk.Close SaveChanges:=False
Next

--
Regards,
Tom Ogilvy



"Steph" wrote in message
...
Hello. I have a folder that has multiple files. I need several of the
files, but not all. Each file has only 1 sheet in it.

I would like to use multiselect to choose the files I need, and copy the
sheet from each of the selected files into a single file. So for

example,
if I chose 7 files, my master file would have 7 sheets in it.

Thanks!








All times are GMT +1. The time now is 12:31 AM.

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