Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can we arrange the sheet tabs in the form of two or more rows ? | Setting up and Configuration of Excel | |||
Selecting tabs in a multipage form | Excel Programming | |||
Looking up values across tabs | Excel Discussion (Misc queries) | |||
Detecting Ctrl-Tabs in User Form input fields? | Excel Programming | |||
Tabstrip tabs entered programmatically disappear after form unload | Excel Programming |