Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mac849
 
Posts: n/a
Default How do I reference values from 200 worksheets onto a summary sheet

I'm using Excel 2003. I have a workbook with over 200 worksheets. (Each tab
named for an individual in a group.) I'm trying to set up a summary sheet
which needs total values from each of the individual worksheets. I'm using a
macro which creates a Table of Contents, then sorts the sheets and the list,
providing a link to each sheet. I expect new names to be added so the macro
will have to be rerun occasionally. A separate macro places the sheet name
in cell A1 of each sheet in case that can be of any use. Is there a way to
get the total values from each sheet onto the summary page without having to
write or modify 200 formulas?
  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Here is one way with event code. Just change the B12 to your cell of choice,
and the Summary sheet name from Summary


Private Sub Workbook_Open()
SheetSummary
End Sub

Private Sub Workbook_SheetActivate(ByVal sh As Object)
If sh.Name = "Summary" Then
SheetSummary
End If
End Sub

Private Sub SheetSummary()
Dim sh As Worksheet
Dim i As Long
i = 1
For Each sh In ActiveWorkbook.Worksheets
If sh.Name < "Summary" Then
Worksheets("Summary").Cells(i, "A").Value = sh.Name
Worksheets("Summary").Cells(i, "B").Formula = "='" & sh.Name &
"'!B12"
i = i + 1
End If
Next sh
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mac849" wrote in message
...
I'm using Excel 2003. I have a workbook with over 200 worksheets. (Each

tab
named for an individual in a group.) I'm trying to set up a summary

sheet
which needs total values from each of the individual worksheets. I'm

using a
macro which creates a Table of Contents, then sorts the sheets and the

list,
providing a link to each sheet. I expect new names to be added so the

macro
will have to be rerun occasionally. A separate macro places the sheet

name
in cell A1 of each sheet in case that can be of any use. Is there a way

to
get the total values from each sheet onto the summary page without having

to
write or modify 200 formulas?



  #4   Report Post  
mac849
 
Posts: n/a
Default

This worked great. (Actually, I got an error until I realized one of the tab
names had an apostrophe in it. She's now named OConnor.) Plus I got a
lesson in workbook event code. Thanks!

"Bob Phillips" wrote:

Here is one way with event code. Just change the B12 to your cell of choice,
and the Summary sheet name from Summary


Private Sub Workbook_Open()
SheetSummary
End Sub

Private Sub Workbook_SheetActivate(ByVal sh As Object)
If sh.Name = "Summary" Then
SheetSummary
End If
End Sub

Private Sub SheetSummary()
Dim sh As Worksheet
Dim i As Long
i = 1
For Each sh In ActiveWorkbook.Worksheets
If sh.Name < "Summary" Then
Worksheets("Summary").Cells(i, "A").Value = sh.Name
Worksheets("Summary").Cells(i, "B").Formula = "='" & sh.Name &
"'!B12"
i = i + 1
End If
Next sh
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mac849" wrote in message
...
I'm using Excel 2003. I have a workbook with over 200 worksheets. (Each

tab
named for an individual in a group.) I'm trying to set up a summary

sheet
which needs total values from each of the individual worksheets. I'm

using a
macro which creates a Table of Contents, then sorts the sheets and the

list,
providing a link to each sheet. I expect new names to be added so the

macro
will have to be rerun occasionally. A separate macro places the sheet

name
in cell A1 of each sheet in case that can be of any use. Is there a way

to
get the total values from each sheet onto the summary page without having

to
write or modify 200 formulas?




  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

LOL. People can be so inconsiderate<g

Anyway, glad we helped.

Bob


"mac849" wrote in message
...
This worked great. (Actually, I got an error until I realized one of the

tab
names had an apostrophe in it. She's now named OConnor.) Plus I got a
lesson in workbook event code. Thanks!

"Bob Phillips" wrote:

Here is one way with event code. Just change the B12 to your cell of

choice,
and the Summary sheet name from Summary


Private Sub Workbook_Open()
SheetSummary
End Sub

Private Sub Workbook_SheetActivate(ByVal sh As Object)
If sh.Name = "Summary" Then
SheetSummary
End If
End Sub

Private Sub SheetSummary()
Dim sh As Worksheet
Dim i As Long
i = 1
For Each sh In ActiveWorkbook.Worksheets
If sh.Name < "Summary" Then
Worksheets("Summary").Cells(i, "A").Value = sh.Name
Worksheets("Summary").Cells(i, "B").Formula = "='" & sh.Name

&
"'!B12"
i = i + 1
End If
Next sh
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mac849" wrote in message
...
I'm using Excel 2003. I have a workbook with over 200 worksheets.

(Each
tab
named for an individual in a group.) I'm trying to set up a summary

sheet
which needs total values from each of the individual worksheets. I'm

using a
macro which creates a Table of Contents, then sorts the sheets and the

list,
providing a link to each sheet. I expect new names to be added so the

macro
will have to be rerun occasionally. A separate macro places the sheet

name
in cell A1 of each sheet in case that can be of any use. Is there a

way
to
get the total values from each sheet onto the summary page without

having
to
write or modify 200 formulas?






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
Summarizing Data across Worksheets using a single reference Mugen123 Excel Worksheet Functions 1 February 25th 05 03:23 PM
Footer values on multiple worksheets Tracy Excel Discussion (Misc queries) 0 February 22nd 05 07:59 PM
How to sum values in multiple worksheets Robert Lawrence Excel Worksheet Functions 3 January 29th 05 05:15 AM
How do I sum values from different worksheets within one workbook. master gardener Excel Worksheet Functions 1 January 28th 05 07:19 PM
HOW DO I REFERENCE A CELL FROM THE RESULTS OF TWO WORKSHEETS TD Excel Discussion (Misc queries) 1 December 14th 04 03:16 PM


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