Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ren Ren is offline
external usenet poster
 
Posts: 67
Default SUM of data from multiple sheets in the mastersheet

hi
i have data in multiple sheets
i want the summary of data in a mastersheet
ex: sheet1 to sheet6

the code is like this

Range("B20") = "summary"
Range("C20").Formula = "=sum('sheet1:sheet6'!c30)"


this code gets the SUM of all data at C30 in sheet1 to sheet6


what i want: is there anyway i can change this so that
i don't have to mention the B20 or C30??

i just say get the "summary" of all the shipout materials
to mastersheet and should be able to get the summary irrespective of the
cell wherever it is.
because everyweek the data keeps adding and i have to change the code
everytime

thanks
Ren


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default SUM of data from multiple sheets in the mastersheet


"Ren" skrev i en meddelelse
...
hi
i have data in multiple sheets
i want the summary of data in a mastersheet
ex: sheet1 to sheet6

the code is like this

Range("B20") = "summary"
Range("C20").Formula = "=sum('sheet1:sheet6'!c30)"


this code gets the SUM of all data at C30 in sheet1 to sheet6


what i want: is there anyway i can change this so that
i don't have to mention the B20 or C30??

i just say get the "summary" of all the shipout materials
to mastersheet and should be able to get the summary irrespective of the
cell wherever it is.
because everyweek the data keeps adding and i have to change the code
everytime

thanks
Ren



Hi Ren

Name the cells, and then refer to the cells. Have a look at this:

Option Explicit
Dim sh As Single
Dim MySum As Long

Sub assignName()
'Name cells
sheets("MasterSheet").range("A1").Name = summary
For sh = 1 To 6
Sheets(sh).Range("A1").Name = "summary" & sh ' Change to suit the cell
Next
End Sub

Sub SumCells()
For sh = 1 To 6
MySum = MySum + Sheets(sh).Range("summary" & sh).Value
Next
Sheets("MasterSheet").Range("summary") = MySum
End Sub

Regards,

Per


  #3   Report Post  
Posted to microsoft.public.excel.programming
Ren Ren is offline
external usenet poster
 
Posts: 67
Default SUM of data from multiple sheets in the mastersheet

Hi Per,

thanks for the reply

i have around 20 sheets, and each sheet name is different.
problem is,if i have to sum up anything, i have to maintain the same range
in all the sheets.(the data keeps adding everyweek)


"Ren" wrote:

hi
i have data in multiple sheets
i want the summary of data in a mastersheet
ex: sheet1 to sheet6

the code is like this

Range("B20") = "summary"
Range("C20").Formula = "=sum('sheet1:sheet6'!c30)"


this code gets the SUM of all data at C30 in sheet1 to sheet6


what i want: is there anyway i can change this so that
i don't have to mention the B20 or C30??

i just say get the "summary" of all the shipout materials
to mastersheet and should be able to get the summary irrespective of the
cell wherever it is.
because everyweek the data keeps adding and i have to change the code
everytime

thanks
Ren


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default SUM of data from multiple sheets in the mastersheet

See this page Ren
http://www.rondebruin.nl/linksum.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ren" wrote in message ...
Hi Per,

thanks for the reply

i have around 20 sheets, and each sheet name is different.
problem is,if i have to sum up anything, i have to maintain the same range
in all the sheets.(the data keeps adding everyweek)


"Ren" wrote:

hi
i have data in multiple sheets
i want the summary of data in a mastersheet
ex: sheet1 to sheet6

the code is like this

Range("B20") = "summary"
Range("C20").Formula = "=sum('sheet1:sheet6'!c30)"


this code gets the SUM of all data at C30 in sheet1 to sheet6


what i want: is there anyway i can change this so that
i don't have to mention the B20 or C30??

i just say get the "summary" of all the shipout materials
to mastersheet and should be able to get the summary irrespective of the
cell wherever it is.
because everyweek the data keeps adding and i have to change the code
everytime

thanks
Ren


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
Mastersheet to Worksheet data copy - macros? DCT Mvumi School Excel Discussion (Misc queries) 1 June 4th 09 12:10 PM
Pulling data from sheet to mastersheet TooN Excel Discussion (Misc queries) 6 September 5th 06 11:41 AM
create multiple worksheets from a mastersheet same workbook Insurance Pam Excel Worksheet Functions 1 August 23rd 06 03:35 PM
Copying Mastersheet layout to the rest of the sheets TooN Excel Programming 0 August 3rd 06 11:26 AM
Copying sheets to a mastersheet Help needed auspcs Excel Programming 2 June 21st 06 12:42 PM


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