+ Reply to Thread
Results 1 to 10 of 10

Look for identical strings and add cell values beside each

  1. #1
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Look for identical strings and add cell values beside each

    Hi guys, I am looking for a macro to do the following:

    Go down a column and identify all accounts that are identical, then add up the values that are 5 columns to the right of each account and paste them on another sheet along with the account code (there are 12 values for each account to be added with the other identical accounts).

    I've attached a spreadsheet, because I understnad this might be kind of confusing. In essence:
    1. Go down column C
    2. Look for accounts that are identical
    3. Add up the values for each account in columns G:R
    4. Copy and paste the added values to another sheet along with columns C:F for each account to identify it

    Thanks for your help in advance!
    Attached Files Attached Files
    Last edited by GeorgY; 02-19-2009 at 02:04 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Look for identical strings and add cell values beside each

    Hello GeorgY,

    I have added the macro listed here to the attached workbook. It will post each account and related data, along with the total on "Sheet3". The data is overwritten each time the macro runs. A button on "Sheet3" runs it.

    Post Totals Macro Code
    Please Login or Register  to view this content.
    PostClass1 Object Code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    10-11-2007
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    251

    Re: Look for identical strings and add cell values beside each

    I created the same thing without VBA. Maybe someone thinks it is useful.

    See attached workbook

  4. #4
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Look for identical strings and add cell values beside each

    Quote Originally Posted by Leith Ross View Post
    Hello GeorgY,

    I have added the macro listed here to the attached workbook. It will post each account and related data, along with the total on "Sheet3". The data is overwritten each time the macro runs. A button on "Sheet3" runs it.
    Thanks Leith, this is great.

    I was wondering if you can just change 3 things:
    1. I actually only need this to be done only to departments 111:129
    2. The totals should be left by month, not all added up into grand total in 1 cell
    3. Can you also paste columbs A:B to Sheet3? The new departments 111:119 can be all renamed to 110 in column B and column A can just concatenate the department and account number

    Thanks again!

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Look for identical strings and add cell values beside each

    Hello GeorgY,

    Are we talking about the same file? I don't see anything in the file I posted that relates to what you have mentioned.

  6. #6
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Look for identical strings and add cell values beside each

    Quote Originally Posted by Leith Ross View Post
    Hello GeorgY,

    Are we talking about the same file? I don't see anything in the file I posted that relates to what you have mentioned.
    Yes, same file. I am talking about Sheet1, before you run your macro...

  7. #7
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Look for identical strings and add cell values beside each

    Would you be able to help me with this Leith?

  8. #8
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Look for identical strings and add cell values beside each

    oops..double posted by accident
    Last edited by GeorgY; 02-18-2009 at 06:28 PM.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Look for identical strings and add cell values beside each

    Hello GeorgY,

    Since there isn't a header row on Sheet1, can you tell me which columns should have what header? I have no idea what you mean by this...
    1. I actually only need this to be done only to departments 111:129

  10. #10
    Registered User
    Join Date
    12-09-2008
    Location
    Canada
    Posts
    79

    Re: Look for identical strings and add cell values beside each

    Quote Originally Posted by Leith Ross View Post
    Hello GeorgY,

    Since there isn't a header row on Sheet1, can you tell me which columns should have what header? I have no idea what you mean by this...
    Hey, thanks for your help. I managed to understand how your code works and changed it to do exactly what I need it to. Thanks again!

+ 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