+ Reply to Thread
Results 1 to 7 of 7

Multiple Unique Distinct Lists

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Multiple Unique Distinct Lists

    Hi, I wonder whether someone may be able to help me please.

    I've put together some VB code in the attached file which performs the following:

    • From the "All Data" sheet find those cells in column E which contain the Value "DIR".
    • If this is found, create a unique distinct list from the associated values in columns D and B. In addition sum the associated values in column H.
    • Paste this information to the "Expected Direct Activities" sheet.

    I can run the macro and correctly create the unique distinct lists from columns D and B taken from the "All Data" sheet and paste this into the correct columns on the "Expected Direct Activities" sheet.

    The problem I'm having is that code is only taking the first value it finds in column H, rather that totalling all of the associated figures.

    To help illustrate the problem, I've created two 'Destination' sheets:
    • The first is "Current Direct Activities". If you select the button on the "Macros" sheet the script will extract the information and paste to this sheet.
    • The second is "Expected Direct Activities". This shows how the information should look if the macro was working correctly.

    I just wondered whether someone could possible look at this please and let me know where I'm going wrong.

    I am relatively new to VB, and it's taken me a while to get to this stage and understand the code, and I just wondered whether someone may be able to just tweak this code rather than change it completely.

    Many thanks and kind regards
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Multiple Unique Distinct Lists

    Try This Code:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Multiple Unique Distinct Lists

    Hi,

    changed code completely, maybe you like it:
    Please Login or Register  to view this content.
    Last edited by tehneXus; 10-06-2013 at 04:44 PM.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Unique Distinct Lists

    Hi hobbiton73

    I too rewrote the Code...runs quick...no need for Sub ShowProgress()
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: Multiple Unique Distinct Lists

    Hi @mehmetcik, thank you for taking the time to reply to my post and for putting the solution together. It works perfectly and it's exactly what I was after.

    All the best and kind regards

  6. #6
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: Multiple Unique Distinct Lists

    Hi @jaslake, thank you for taking the time to view and reply to my post with the solution you kindly put together, it is greatly appreciated.

    Many thanks and kind regards

  7. #7
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: Multiple Unique Distinct Lists

    Hi @tehneXus, thank you for taking the time to reply to my post and for putting the solution together, it is greatly appreciated.

    Many thanks and kind regards

+ 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. VBA Dependent Unique Distinct Lists
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-10-2013, 02:42 PM
  2. Validation Lists - Multiple dependent lists with unique values
    By Lewigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 06:42 AM
  3. LISTS! identifying unique values in multiple lists
    By pwall1115 in forum Excel General
    Replies: 3
    Last Post: 04-09-2013, 03:36 AM
  4. Replies: 5
    Last Post: 03-13-2012, 06:05 AM
  5. Replies: 1
    Last Post: 03-02-2011, 04:14 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