+ Reply to Thread
Results 1 to 4 of 4

Adding up values and grand totals through vba

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Adding up values and grand totals through vba

    Hi All

    I am generating certain number for a table. I am trying to write a vba code for numbers to be added row wise and column wise.
    I am unable to move the second row to add the values in column "O". Below is the code, can u tell me how to move to the next row
    so that sum is generated .

    Please Login or Register  to view this content.
    Many thanx in advance
    Attached Files Attached Files
    Never confuse a single defeat to the final defeat.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Adding up values and grand totals through vba

    Why not just use a regular SUM() function?

    =SUM(C2:C27) for the columns, copied across
    =SUM(C2:N2) for the rows, copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Re: Adding up values and grand totals through vba

    well i just wanted to know how we do it in vba, and i also wanted to know how we move from one row to another row,
    i vaguely know it should be done through offset function / end(xlup) something like this.

  4. #4
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Re: Adding up values and grand totals through vba

    All i wanted to do is add values in a single row (example from c2 to g2) and get the sum in h2
    and move to c3 to g3 and get the sum in h3.

    Any ideas ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Grand Totals to top of page
    By Cburrows in forum Excel General
    Replies: 4
    Last Post: 03-08-2012, 01:58 PM
  2. Method for calculating Invoice Totals and Grand totals
    By sahran4441 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2010, 10:24 PM
  3. Replies: 4
    Last Post: 01-10-2008, 12:31 PM
  4. [SOLVED] Can't get Grand Totals (rows) to appear
    By TonyG in forum Excel General
    Replies: 1
    Last Post: 05-23-2006, 10:06 PM
  5. [SOLVED] Pivottable:adding grand totals
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 12-06-2005, 06:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1