+ Reply to Thread
Results 1 to 3 of 3

create a loop that adds values

  1. #1
    Registered User
    Join Date
    03-27-2005
    Posts
    59

    create a loop that adds values

    is it poissible vba code to loop down column A for and for each value "cat" add up the associated value for it in column B on the same row and show the answer in column C?
    i.e
    A B C
    cat 1 answer 9
    dog 2
    cat 5
    dog 1
    cat 3

    hope someone can help thanks

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: create a loop that adds values

    Do you really need VBA - why not just use SUMIF or a Pivot Table ?

    SUMIF ex.

    C1: =SUMIF(A:A,A1,B:B)
    copied down

  3. #3
    Registered User
    Join Date
    03-27-2005
    Posts
    59

    Smile Re: create a loop that adds values

    lol thats exactly what i wanted thanks, think i was tyring to overcomplicate it.
    many thank yous

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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