LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy worksheets into new file

I am currently trying to write a macro to run a summary. I hav
numerous Excel files under a folder and I would like to have specifi
tabs copied into one workbook. Below is the code that I have tried an
is not working. Any sugestions would be great. Also would it b
possible to name the tabs off a specific cell in each worksheet?

Thanks in advance!!

Sub RyanTabCombo()

Application.ScreenUpdating = False
Dim FName As String
Dim WB As Workbook
Dim Dest As Range
Const FOLDERNAME = "C:\Excel Test\Summaries"
ChDrive FOLDERNAME
ChDir FOLDERNAME

Workbooks.Open Filename:= _
"C:\Excel Test\Ryan - Summary Template.xls"
Set Dest = Range("A1")
FName = Dir("*.xls")

Do Until FName = ""
Set WB = Workbooks.Open(FName)
WB.Worksheets("Sheet1").Move Destination:=Dest
WB.Close savechanges:=False
Set Dest = Windows("Ryan - Summary Template.xls")
FName = Dir()
Loop

MsgBox "The summary is completed. Thank you."

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\Excel Test\Ryan - " & Format(Date
"mm-dd-yyyy") & ".xls"
ActiveWorkbook.Close

End Su

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

 
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
How keep links when copy worksheets to another file? Jack B Excel Discussion (Misc queries) 2 January 19th 09 01:45 AM
how do i copy a cell in worksheets 10 to the other 9 worksheets bete New Users to Excel 3 March 15th 07 10:41 AM
How to shrink file sizes after eliminating worksheets in file Sandals Excel Discussion (Misc queries) 2 July 27th 06 07:04 PM
copy between worksheets does not copy formulae just values Chris@1000 Oaks Excel Discussion (Misc queries) 0 March 19th 06 11:44 AM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


All times are GMT +1. The time now is 04:13 AM.

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

About Us

"It's about Microsoft Excel"