Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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
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
Summing 2 columns cells into a 3rd colums cells Wayne Cadigan Excel Discussion (Misc queries) 1 May 13th 10 08:34 PM
summing 3 worksheets on a total sheet jliv Excel Discussion (Misc queries) 1 February 18th 09 06:48 PM
Summing values from an undetermined number of sheet smaruzzi Excel Worksheet Functions 3 April 6th 07 08:16 PM
Finding cells and summing variable cells Chris M.[_3_] Excel Programming 3 August 21st 03 09:13 PM


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