![]() |
Import File Data
Hi,
In a folder I have 10 excel files and I want to copy sheet2 data of all the exel file from the folder. Copied data will be pasted in a book.xlsx. Is it possible ? Eg, Folder called ABC and in that 10 excel files 001.xlsx, 002.xlsx........ Thanks in advance |
Import File Data
Hi,
You can use this add-in if you want it easy http://www.rondebruin.nl/merge.htm Or see the code links on that page -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm wrote in message ... Hi, In a folder I have 10 excel files and I want to copy sheet2 data of all the exel file from the folder. Copied data will be pasted in a book.xlsx. Is it possible ? Eg, Folder called ABC and in that 10 excel files 001.xlsx, 002.xlsx........ Thanks in advance |
Import File Data
This is just a demo. I have three files in a folder called "test". I open
the files sequentially and copy sheet2 of each file to the original sheet and save the original as book.xls. Change the extension to match your needs: Sub sheeet2() Dim s(10) As String, wb As Workbook Dim wbt As Workbook s(0) = "C:\test\alpha.xls" s(1) = "C:\test\beta.xls" s(2) = "C:\test\gamma.xls" Set wb = ActiveWorkbook For i = 0 To 2 Workbooks.Open Filename:=s(i) Set wbt = ActiveWorkbook Sheets("Sheet2").Copy Befo=wb.Sheets(1) wbt.Close wb.Activate Next ActiveWorkbook.SaveAs Filename:="C:\test\book.xls" End Sub -- Gary''s Student - gsnu2007L " wrote: Hi, In a folder I have 10 excel files and I want to copy sheet2 data of all the exel file from the folder. Copied data will be pasted in a book.xlsx. Is it possible ? Eg, Folder called ABC and in that 10 excel files 001.xlsx, 002.xlsx........ Thanks in advance |
Import File Data
Thanks ron,
that's really nice one. I am not suppose to use add ins in office, If u provide code that will be helpful. On Mar 15, 4:17*pm, "Ron de Bruin" wrote: Hi, You can use this add-in if you want it easyhttp://www.rondebruin.nl/merge..htm Or see the code links on that page -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm wrote in ... Hi, In a folder I have 10 excel files and I want to copy sheet2 data of all the exel file from the folder. Copied data will be pasted in a book.xlsx. Is it possible ? Eg, Folder called ABC and in that 10 excel files 001.xlsx, 002.xlsx........ Thanks in advance |
Import File Data
See the "More Information" part of the page for the code links
-- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm wrote in message ... Thanks ron, that's really nice one. I am not suppose to use add ins in office, If u provide code that will be helpful. On Mar 15, 4:17 pm, "Ron de Bruin" wrote: Hi, You can use this add-in if you want it easyhttp://www.rondebruin.nl/merge.htm Or see the code links on that page -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm wrote in ... Hi, In a folder I have 10 excel files and I want to copy sheet2 data of all the exel file from the folder. Copied data will be pasted in a book.xlsx. Is it possible ? Eg, Folder called ABC and in that 10 excel files 001.xlsx, 002.xlsx........ Thanks in advance |
All times are GMT +1. The time now is 06:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com