Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to create individual files from a multi sheet excel rgxl Excel Worksheet Functions 1 March 28th 07 07:51 AM
need to hyperlink to 100 files in the excel sheet anil Excel Discussion (Misc queries) 1 March 14th 07 03:40 PM
To include the name of files from a folder to the excel sheet anil Excel Discussion (Misc queries) 1 January 17th 07 09:43 AM
HELP linking to PDF files from Excel sheet on CD [email protected] Excel Discussion (Misc queries) 1 July 4th 06 04:55 PM
Problems Creating html files with excel sheet Bigredno8 Excel Discussion (Misc queries) 1 July 5th 05 11:28 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"