+ Reply to Thread
Results 1 to 9 of 9

Creating list based on 3 criteria

  1. #1
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Creating list based on 3 criteria

    Hi,

    Please see attached.

    I need to create (via a macro) a seperate list on Sheet2 based on the values on Sheet1. If the entries in column A have a "A" "B" & "C" (in any order) in column B, then all 3 rows should be copied to Sheet2, as per the example.

    I'd be glad of any help. If a solution can be found, please post the code rather than an attachment. Thanks in advance.
    Attached Files Attached Files
    Last edited by bd528; 09-10-2010 at 01:46 PM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Creating list based on 3 criteria

    You could use this macro:

    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Creating list based on 3 criteria

    Hi,

    Thats works perfectly - thanks.

    How can I get this to work if I change the values in row B? For example all the A's are "Mouse", all the B's are "Cat" and all the C's are "Dog".

    Thanks again.

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Creating list based on 3 criteria

    You could try with this macro (you can put B values in any order and the match is not case sensitive):

    Please Login or Register  to view this content.
    Regards,
    Antonio

  5. #5
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Creating list based on 3 criteria

    Antonio,

    Again, that works perfectly. I have thought of one final change, if you have any suggesions...?

    Currently, the value in column A must have mouse, cat, and dog in column B before it is copied to Sheet2. It would be good if the column A figure figure went to Sheet2 if it only has mouse as well - as per the example attached.

    This is the last change - honestly

    Thanks so much.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Creating list based on 3 criteria

    You could use this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  7. #7
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Creating list based on 3 criteria

    Antonio,

    Thanks for your reply. Your code above brings through all entries that have a "Mouse" - even entries that have just "Mouse" and "Cat". What I'd like on Sheet2 is all entries that have "Mouse", "Cat" and "Dog", or just "Mouse" on its own.

    Is that possible?

  8. #8
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Creating list based on 3 criteria

    I apologize for the delay of my answer.

    You could use this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  9. #9
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Creating list based on 3 criteria

    Thats perfect. Thanks for your time and help

+ 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