Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default add sheet values

hi,

i would like to know how i can havea summary sheet which takes all the
values from cell C2 frmo each sheet and add them up on the summary sheet.

the problem is that people can add sheets dynamically like there could be
anywhere from 1 to 10 sheets. but the sheet names can be like sheet1,
sheet2, etc.

i would like for the cell on the summary sheet to be something like ...
=sheet1!C2 + sheet2!C2 and so forth.

but i want the formula to go all the way up to indlue cells from sheet10. i
would like to know how i can change this formula dynamically so that it
reflects adding up cell C2 from 2 sheets, etc. all the way up to 10 sheets.

thanks in advance,
geebee


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default add sheet values

Use this UDF:

Function zum() As Variant
Application.Volatile
zum = 0
For Each w In Worksheets
zum = zum + w.Range("C2").Value
Next
End Function

--
Gary''s Student - gsnu200770


"geebee" wrote:

hi,

i would like to know how i can havea summary sheet which takes all the
values from cell C2 frmo each sheet and add them up on the summary sheet.

the problem is that people can add sheets dynamically like there could be
anywhere from 1 to 10 sheets. but the sheet names can be like sheet1,
sheet2, etc.

i would like for the cell on the summary sheet to be something like ...
=sheet1!C2 + sheet2!C2 and so forth.

but i want the formula to go all the way up to indlue cells from sheet10. i
would like to know how i can change this formula dynamically so that it
reflects adding up cell C2 from 2 sheets, etc. all the way up to 10 sheets.

thanks in advance,
geebee


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default add sheet values

hi,

thanks. now i am just trying to figure out how to display the zum value in
a cell. i typed =zum

but it doesnt work

thanks in advance,
geebee


"Gary''s Student" wrote:

Use this UDF:

Function zum() As Variant
Application.Volatile
zum = 0
For Each w In Worksheets
zum = zum + w.Range("C2").Value
Next
End Function

--
Gary''s Student - gsnu200770


"geebee" wrote:

hi,

i would like to know how i can havea summary sheet which takes all the
values from cell C2 frmo each sheet and add them up on the summary sheet.

the problem is that people can add sheets dynamically like there could be
anywhere from 1 to 10 sheets. but the sheet names can be like sheet1,
sheet2, etc.

i would like for the cell on the summary sheet to be something like ...
=sheet1!C2 + sheet2!C2 and so forth.

but i want the formula to go all the way up to indlue cells from sheet10. i
would like to know how i can change this formula dynamically so that it
reflects adding up cell C2 from 2 sheets, etc. all the way up to 10 sheets.

thanks in advance,
geebee


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default add sheet values

=zum()
--
Gary''s Student - gsnu200770
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default add sheet values

hi,

ok lets just say that we do not want it to include the values from a few of
the sheets. how do we add the code to state which sheets it should not take
values from?

thanks in advance,
geebee


"Gary''s Student" wrote:

=zum()
--
Gary''s Student - gsnu200770



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default add sheet values

Easiest methos is to create a sandwich with the sheets as the filler.

Assuming Summary sheet is first in workbook.

Insert a dummy sheet to the right of Summary sheet..........name it Start

Insert a dummy sheet at end..........name it End

In your summary sheet =SUM(Start:End!C2)

When adding new sheets insert them between Start and End.

Sheetnames can be anything.


Gord Dibben MS Excel MVP

On Wed, 27 Feb 2008 10:24:00 -0800, geebee (noSPAMs)
wrote:

hi,

i would like to know how i can havea summary sheet which takes all the
values from cell C2 frmo each sheet and add them up on the summary sheet.

the problem is that people can add sheets dynamically like there could be
anywhere from 1 to 10 sheets. but the sheet names can be like sheet1,
sheet2, etc.

i would like for the cell on the summary sheet to be something like ...
=sheet1!C2 + sheet2!C2 and so forth.

but i want the formula to go all the way up to indlue cells from sheet10. i
would like to know how i can change this formula dynamically so that it
reflects adding up cell C2 from 2 sheets, etc. all the way up to 10 sheets.

thanks in advance,
geebee


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
building a reporting sheet which reports by date and shows values of another sheet Tom Ogilvy Excel Programming 0 October 11th 05 01:12 PM
copy values generated by conditional formula in one sheet to the other work sheet as values ramana Excel Worksheet Functions 1 October 5th 05 01:04 PM
copy values generated by conditional formula in one sheet to the other work sheet as values bobby Excel Discussion (Misc queries) 1 October 5th 05 12:18 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in test test Excel Programming 3 September 9th 03 08:53 PM


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