Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
Hi all,
I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
you can arrage the codes as following:
With Worksheets("Actual vs Budget") Range("E10").Value = .Range("C36") + .Range("E36") + .Range("G36") + ..Range("i36") End With -- msn --------------------------------------------- the best time to plant a tree was twenty years ago. the second best time, is today - Chinese proverb "Carlee" wrote: Hi all, I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
You can use this formula in Range("E10").
=SUM('Actual vs Budget'!C36,'Actual vs Budget'!E36,'Actual vs Budget'!G36,'Actual vs Budget'!I36) If want the code, turn on the macro recorder and record the formula for Range("E10"). You can modify to suit. Regards, Alan "Carlee" wrote in message ... Hi all, I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
Try this:
Range("E10").Value = WorkSheetFunction.Sum(Worksheets("Actual vs Budget").Range("C36, E36, G36, I36") "Carlee" wrote: Hi all, I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
Range("E10").Value = WorkSheetFunction.Sum(Worksheets("Actual vs
Budget").Range("C36, E36, G36, I36")) Keep forgetting to count the parentheses. :) "JLGWhiz" wrote: Try this: Range("E10").Value = WorkSheetFunction.Sum(Worksheets("Actual vs Budget").Range("C36, E36, G36, I36") "Carlee" wrote: Hi all, I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing cells on a different sheet
Third time is a charm:
Range("E10").Value = Application.WorkSheetFunction.Sum(Worksheets("Actu al vs Budget").Range("C36, E36, G36, I36")) OK, that's it! This time I looked before I posted. "Carlee" wrote: Hi all, I am using the following VBA to sum several discontiguous cells from Sheet 1, and placing the total on Sheet 2. Is there a more efficient way of doing this without getting too into coding? I am not a strong coder adn want to avoid it if I can. Range("E10").Value = Worksheets("Actual vs Budget").Range("C36") + Worksheets("Actual vs Budget").Range("E36") + Worksheets("Actual vs Budget").Range("G36") + Worksheets("Actual vs Budget").Range("i36") -- Carlee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summing 2 columns cells into a 3rd colums cells | Excel Discussion (Misc queries) | |||
summing 3 worksheets on a total sheet | Excel Discussion (Misc queries) | |||
Summing values from an undetermined number of sheet | Excel Worksheet Functions | |||
Finding cells and summing variable cells | Excel Programming |