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: 27,285
Default linking sheets

Dim charCode as Variant, arCharCode as Variant
Dim sStr as String, sStr1 as String
Dim wkbk as Workbook, wkbk1 as Workbook
Dim sPath as String
sPath = "C:\Myfolder\MyData\"
arCharCode = Array(
"A10490",
"B12368",
"C33345",
. . . ,
"DD1036")

for each charcode in arCharCode
sStr = "Targetfile " & charcode & " 03 2004.xls"
sStr1 = "Sourcefile " & charcode & " 03 2004.xls"
set wkbk = workbooks.open( sPath & sStr)
set wkbk1 = workbooks.open( sPath & sStr1)
wkbk.Worksheets(1).Range("R14:R75").Value = _
wkbk1.Worksheets(1).Range("R14:R75").Value
wkbk1.close SaveChanges:=False
wkbk.Close SaveChanges:=True
Next

code is untested and may contain typos.

--
Regards,
Tom Ogilvy

"Jem" wrote in message
...
I need to arrange for a collection of workbooks to be updated from data

contained in another collection of workbooks as follows:


Targetfile A10490 03 2004.xls needs to have range R14:R75 populated by the

data in Sourcefile A10490 03 2004.xls.

The same action then needs to be performed for another 29 pairs of

workbooks with identical worksheet names except for the 6 character code
(A10490) in the middle of the name. This code is always the 19th -24th
characters in the workbook name.



 
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
Linking Sheets Lynda Excel Worksheet Functions 10 October 31st 06 11:12 PM
Linking Sheets Phippsy Links and Linking in Excel 4 February 28th 06 08:39 AM
Linking sheets Alex01 Excel Discussion (Misc queries) 2 August 15th 05 11:12 PM
Linking sheets Smith Excel Discussion (Misc queries) 1 March 17th 05 09:35 PM
Sheets Linking neelam Excel Programming 1 October 7th 03 08:04 PM


All times are GMT +1. The time now is 01:50 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"