Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Sum values form different tabs

I need a macro that will sum the values from Cell A7 from every tab in the
current spread sheet however excluding three tabs " SheetABC", "SheetMNH" and
"SheetXYZ" and insert the result in Cell A7 in "SheetMNH"
Then i want to do the same with the values in Cell A8, A9, A10 and A11 and
put the results in A8, A9, A10 and A11 in "SheetMNH".
Any help will be very much appreciated!
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sum values form different tabs

Hi

Try the sandwich Tip on the page
http://www.rondebruin.nl/linksum.htm



--

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


"vlad" wrote in message ...
I need a macro that will sum the values from Cell A7 from every tab in the
current spread sheet however excluding three tabs " SheetABC", "SheetMNH" and
"SheetXYZ" and insert the result in Cell A7 in "SheetMNH"
Then i want to do the same with the values in Cell A8, A9, A10 and A11 and
put the results in A8, A9, A10 and A11 in "SheetMNH".
Any help will be very much appreciated!
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Sum values form different tabs

Couple different ways this could be done. Here is a quickie. This
will do A7 through A11. If you need to go further than row 11, just
change the finalRow variable.
Sub sumThis()
Dim ws As Worksheet, finalRow As Long
Dim mainWS As Worksheet, s As Long
Dim i As Integer 'change to Long if needed
Set mainWS = Sheets("SheetMNH")
finalRow = 11 'change as needed
For i = 7 To finalRow
s = 0
For Each ws In ActiveWorkbook.Worksheets
If Not ws.Name = "SheetMNH" _
And Not ws.Name = "SheetABC" _
And Not ws.Name = "SheetXYZ" Then _
s = s + ws.Cells(i, 1)
Next ws
mainWS.Cells(i, 1) = s
Next i
Set mainWS = Nothing
End Sub
vlad wrote:
I need a macro that will sum the values from Cell A7 from every tab in the
current spread sheet however excluding three tabs " SheetABC", "SheetMNH" and
"SheetXYZ" and insert the result in Cell A7 in "SheetMNH"
Then i want to do the same with the values in Cell A8, A9, A10 and A11 and
put the results in A8, A9, A10 and A11 in "SheetMNH".
Any help will be very much appreciated!
Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Sum values form different tabs

Ron and JW,
Many thanks i tried bought and they work. Thanks again

"vlad" wrote:

I need a macro that will sum the values from Cell A7 from every tab in the
current spread sheet however excluding three tabs " SheetABC", "SheetMNH" and
"SheetXYZ" and insert the result in Cell A7 in "SheetMNH"
Then i want to do the same with the values in Cell A8, A9, A10 and A11 and
put the results in A8, A9, A10 and A11 in "SheetMNH".
Any help will be very much appreciated!
Thanks

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
Can we arrange the sheet tabs in the form of two or more rows ? About arranging sheet tabs Setting up and Configuration of Excel 1 June 21st 08 12:22 PM
Selecting tabs in a multipage form CSUS_CE_Student[_2_] Excel Programming 1 August 27th 07 07:24 PM
Looking up values across tabs [email protected] Excel Discussion (Misc queries) 3 June 5th 07 04:20 PM
Detecting Ctrl-Tabs in User Form input fields? Don Wiss Excel Programming 1 February 23rd 05 01:17 AM
Tabstrip tabs entered programmatically disappear after form unload cumchee Excel Programming 1 January 21st 05 08:04 PM


All times are GMT +1. The time now is 10:24 AM.

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"