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 a Summary Workbook

Sub AABB()
Dim sPath As String
Dim v As Variant
Dim bk As Workbook
Dim bkSum As Workbook
Dim i As Long
Dim sh As Worksheet
Dim cell As Range
Dim rng As Range
sPath = "C:\Documents and Settings\MyDocuments\"
v = Array("WB1.xls", "WB2.xls", "WB3.xls")
Set bk = Workbooks.Open(sPath & v(LBound(v)))
bk.Worksheets.Copy
Set bkSum = ActiveWorkbook
bk.Close SaveChanges:=False
For i = LBound(v) + 1 To UBound(v)
Set bk = Workbooks.Open(sPath & v(LBound(v)))
For Each sh In bkSum.Worksheets
For Each cell In sh.UsedRange
If IsNumeric(cell.Value) Then
Set rng = bk.Worksheets(sh.Name).Range(cell.Address)
If IsNumeric(rng.Value) Then
cell.Value = cell.Value + rng.Value
End If
End If
Next
Next
Next
End Sub


--
Regards,
Tom Ogilvy




"Ronbo" wrote in message
...
I have 3 workbooks (and adding), with 20 worksheets each, with all

workbooks
and worksheets laid out exactly the same, I want a summary workbook that
would add each worksheet from the 3 workbooks together so that the summary
workbook would have 20 worksheets exactly the same as the 3 originals.
i.e.C:\Documents and Settings\My

Documents\[WB1.xls]Sheet1'!A1+C:\Documents
and Settings\My Documents\[WB2.xls]Sheet1'!A1+'C:\Documents and SettingsMy
Documents[WB3.xls]Sheet1'!A1.

I know that I can copy this across and down, but I do not want to do it

that
way because it is very time consuming to add a new workbook and it won't

be
long before I run out of character space in the formula.

I checked out Ron de Bruins site, but I did not find anything that adds

the
sheet together.

I am looking for a way to add the workbooks or worksheets together and
easily add a new workbook. Any help or suggestions would be appreciated.



 
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 multiple databases to one summary page BK Excel Worksheet Functions 0 May 17th 10 08:40 PM
Linking Worksheets to a Summary Worksheet Nell Excel Worksheet Functions 1 November 27th 07 01:56 AM
Linking to Summary Tab JS Excel Discussion (Misc queries) 5 December 5th 06 06:48 PM
Linking a Summary Workbook Ron de Bruin Excel Programming 2 June 24th 05 08:12 PM
Linking sheets to a summary sheet in workbook gambinijr Excel Discussion (Misc queries) 4 December 16th 04 08:13 PM


All times are GMT +1. The time now is 08:59 PM.

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"