Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mass copy of excel docs

I have {30} several documents -- Excel that I want to copy some cells
to a new template. I want to use a macro for this. Any suggestions??

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Mass copy of excel docs

How can the several documents be identified. To they all start with a
common root word. Are they the only .xls files in a directory.

Copy to a new template -

do you want to consolidate all on one page

Dim bk1 as Workbook, bk as Workbook
Dim sName as String, dim rng as Range
set bk1 = Workbooks.Add
sName = Dir("C:\MyDocs\*.xls")
do while sName < ""
set bk = Workbooks.Open("C:\MyDocs\" & sName)
bk.worksheets(1).Range("A1").Resize(5,5).copy
set rng = bk1.Worksheets(1).Cells(rows.count,1).End(xlup)(2)
rng.PasteSpecial xlValues
bk.close SaveChanges:=False
sName = Dir()
Loop

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
I have {30} several documents -- Excel that I want to copy some cells
to a new template. I want to use a macro for this. Any suggestions??



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
Excel docs not saving as excel docs Beth Excel Discussion (Misc queries) 6 September 12th 06 02:39 AM
i have lost the small + that allows mass copy of formulas in excel Brendan Excel Discussion (Misc queries) 1 January 17th 06 03:29 AM
Formula Mass Copy??? onesidered Excel Discussion (Misc queries) 1 August 8th 05 05:03 PM
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs mr_melvis Excel Worksheet Functions 1 April 8th 05 03:00 AM
converting excel docs to word docs rolercster New Users to Excel 2 January 4th 05 07:11 PM


All times are GMT +1. The time now is 11:44 AM.

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"