+ Reply to Thread
Results 1 to 3 of 3

How to insert rows+add based on the conditions

  1. #1
    Registered User
    Join Date
    09-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to insert rows+add based on the conditions

    Good day everyone,I am just starting my Excel VBA code practice. Here is one practice that I'd like to achieve. But, I just couldn't sort it out.
    There are Column A "Name", column B "Point", and column C "ID" in the spreadsheet. There are several different names randomly listed under the A, and some of them are repeated. Here is what I've been trying to do.

    For A
    1. Sort all the name alphabeticly;
    2. If the name only shows once, to insert a row right below of it.
    3. If the names show more than once, to insert two rows right after them, and then type in "(Names) Total" into the first inserted row.

    For B
    Add all the points together which corresponded to that name when A.3 criteria happens, and shows the total point value right after them.

    For C
    To count how many "ID"s (on the other word, try to count how many times that specific name showed up)which corresponded to that name when A.3 criteria happens, and then have the total number right after them.


    Note: based on the above state, the "(Names) Total" in A, total point in B, and total times should all in the same row.


    Please let me know if there are more information needed.

    Thank you in advance


    Live long and prosper. \V/

  2. #2
    Registered User
    Join Date
    09-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to insert rows+add based on the conditions

    Any partial codes would help, too. Thank you in advance

  3. #3
    Registered User
    Join Date
    09-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to insert rows+add based on the conditions

    Here is the format example:

    Before

    A (NAME) B (POINT) C (ID)
    ALLEN 23 9
    ALLEN 56 8
    BRUCE 123 13
    BRUCE 75 58
    BRUCE 46 98
    KATE 5 8
    RICH 61 85

    After

    A (NAME) B (POINT) C (ID)
    ALLEN 23 9
    ALLEN 56 8
    ALLEN Total 79 2
    BRUCE 123 13
    BRUCE 75 58
    BRUCE 46 98
    BRUCE Total 244 3
    KATE 5 8

    RICH 61 85

    Milllion thanks for all the helps, Thank you~

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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