+ Reply to Thread
Results 1 to 2 of 2

Creating a simple loop to compare values

  1. #1
    Registered User
    Join Date
    09-18-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    1

    Creating a simple loop to compare values

    Hi everyone.

    I am very new to scripting, and I need some help creating a vb script ( macro ) that does the following in Excel 2003.

    Basically, I'll have 4 Columns, say A B C and D. A B and C are ID's lets say, and column D is a dollar value. Some rows will be the same ( their A B C values ) , and some rows will have differing values.

    I need to have some type of loop that takes the first row, copies it somewhere ( same worksheet or a different, new one ) and then takes its dollar value ( column D ), and saves it, and then loops to the next row, and if the ABC values are the SAME, it ADDS to the dollar value, and then goes on. And then, once it goes through all of the rows, it goes to the next row and does the same thing. However, I need it so that the final output has only ONE copy of the identical ABC rows and its SUMMED dollar value.

    So if there are 10 rows, and there are 2 sets of 5 identical rows, the final report or worksheet or whatever would only have 2 A B C colums and only 2 Dollar totals.

    I hope I explained it as best I can. It seems to be a small If statement but i have never programmed and am lost. Any help is appreciated.

    Thanks in Advance!

    -Marv
    Last edited by marvelous1; 09-18-2009 at 02:40 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: New comer to Excel needs help!

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ 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