![]() |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 09:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com