+ Reply to Thread
Results 1 to 11 of 11

VBA - Extracting unique data based on multiple criteria

  1. #1
    Registered User
    Join Date
    04-27-2017
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    38

    VBA - Extracting unique data based on multiple criteria

    Hello All,

    Hoping someone can kindly assist with this query.

    At present, I am using the following code for extracting unique data (but without any conditions):

    Please Login or Register  to view this content.
    What I'd also like to be able to do, is still extract the above but only when the values in Sheet1 Column A = Sheet2 $A$1 and Sheet 1 Column K = Sheet 2 $B$1.

    Hoping this is possible and that I've appropriately conveyed what I need.

    Thanks ever so much for the support.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA - Extracting unique data based on multiple criteria

    Hi donjamin

    Play around with this...assuming sheet1 has headers in row 1
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-27-2017
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    38

    Re: VBA - Extracting unique data based on multiple criteria

    Thanks sintek, much appreciate your support, however (and apologies) this isn't working and may be due to my lack of clarity.

    Where I noted it needed to match values in Sheet 1 Column A, it actually needs to match text, with Sheet 1 Column K being the value.

    Hope that helps.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA - Extracting unique data based on multiple criteria

    Please upload a sample file...

  5. #5
    Registered User
    Join Date
    04-27-2017
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    38

    Re: VBA - Extracting unique data based on multiple criteria

    I'm struggling to figure out how to attach something as when I go to do it I'm just seeing a blank white box.

    Any ideas?

    I have managed to get this VBA to work, though without the desired result.

    My originally posted VBA would look at the entire workbook Column A - FJ and provide the unique values from column AC in the next sheet. I need the new one to just do that but with the conditions. The result of the VBA you've kindly provided is filtering as desired but only returning columns 1-12 when I just require column 29.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VBA - Extracting unique data based on multiple criteria

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA - Extracting unique data based on multiple criteria

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-27-2017
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    38

    Re: VBA - Extracting unique data based on multiple criteria

    Sintek, you're a legend!

    Are you able to remove duplicates from within that code?

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA - Extracting unique data based on multiple criteria

    Give this version a go...tx jindon
    Please Login or Register  to view this content.


    EDit...Forgot...
    Are you able to remove duplicates from within that code?
    Please Login or Register  to view this content.
    Last edited by sintek; 04-18-2019 at 06:39 AM.

  10. #10
    Registered User
    Join Date
    04-27-2017
    Location
    London
    MS-Off Ver
    MS Office 2013
    Posts
    38

    Re: VBA - Extracting unique data based on multiple criteria

    Works brilliantly, thank you very much sintek!

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA - Extracting unique data based on multiple criteria

    ............................................
    Thanks.gif
    Please mark thread as solved...

+ 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. Distinct function/ Formula or Unique Data based on multiple criteria
    By naveeddil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2019, 10:49 PM
  2. Extracting rows of data based on multiple criteria from a list
    By cnak in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-04-2018, 12:10 PM
  3. [SOLVED] Extracting unique data based on criteria
    By Jolene78 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2017, 08:19 AM
  4. Extract Unique data based on multiple criteria
    By ajaypal.sp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-27-2016, 01:13 PM
  5. Adding a date range to a unique data count based on multiple criteria
    By Matthew_Smith86 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-10-2015, 08:50 AM
  6. Extracting Unique Records and Copying into Another Sheet Based on Various Criteria
    By abutler911 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2013, 11:09 AM
  7. Extracting rows based on multiple ranges and unique numbers
    By D13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2012, 09:33 AM

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