+ Reply to Thread
Results 1 to 11 of 11

VBA - Extracting unique data based on multiple criteria

Hybrid View

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

    Re: VBA - Extracting unique data based on multiple criteria

    Give this version a go...tx jindon
    Sub Extract2()
    Dim Valu, Temp(), i As Long, cnt As Long
    With Sheet1.Cells(1).CurrentRegion.Resize(, 28)
        Valu = .Value: cnt = 0
        For i = 1 To UBound(Valu, 1)
            If Valu(i, 1) = Sheet2.Range("A1") And Valu(i, 11) = Sheet2.Range("B1") Then
                ReDim Preserve Temp(cnt)
                If Not IsNumeric(Application.Match(Valu(i, 28), Temp, 0)) Then
                    Temp(cnt) = Valu(i, 28)
                    cnt = cnt + 1
                End If
            End If
        Next i
    End With
    Sheet2.Range("A3").Resize(cnt) = Application.WorksheetFunction.Transpose(Temp)
    End Sub


    EDit...Forgot...
    Are you able to remove duplicates from within that code?
    Sheet2.Columns("A:A").RemoveDuplicates 1
    Last edited by Sintek; 04-18-2019 at 06:39 AM.
    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 [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  2. #2
    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!

+ 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