Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
how do i add a particular sheet to more than one excel files
Hi ,
I stuck to problem actually i want to add a particular sheet to the more than 50 excel files at the same time because i have got 50 files so its time consuming to open them one by one .please help me in this regard. Thanks U.A |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
how do i add a particular sheet to more than one excel files
Try this:-
Code goes in your donor workbook. Alter the path and sheet name to suit:- Sub LoopFiles() Dim sDirectory As String Dim sSpec As String Dim sBook As String Dim oBook As Workbook sDirectory = "c:\myfiles" '< Change to suit sSpec = "*.xls" sBook = Dir(sDirectory & "\" & sSpec) Do Worksheets("Sheet4").Select Worksheets("sheet4").Cells.Select '< Change copied sheet to suit Selection.Copy Set oBook = Workbooks.Open(sDirectory & "\" & sBook) Windows(sBook).Activate Sheets.Add.Name = "My Copied Sheet" '< Change to suit Cells.Select ActiveSheet.Paste oBook.Save oBook.Close sBook = Dir() Loop Until sBook = "" End Sub Mike "sonu" wrote: Hi , I stuck to problem actually i want to add a particular sheet to the more than 50 excel files at the same time because i have got 50 files so its time consuming to open them one by one .please help me in this regard. Thanks U.A |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a way to create individual files from a multi sheet excel | Excel Worksheet Functions | |||
need to hyperlink to 100 files in the excel sheet | Excel Discussion (Misc queries) | |||
To include the name of files from a folder to the excel sheet | Excel Discussion (Misc queries) | |||
HELP linking to PDF files from Excel sheet on CD | Excel Discussion (Misc queries) | |||
Problems Creating html files with excel sheet | Excel Discussion (Misc queries) |