+ Reply to Thread
Results 1 to 4 of 4

Extract a list that allows specific value to have duplicates but not any other values.

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Stuarts Draft, VA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Extract a list that allows specific value to have duplicates but not any other values.

    Hi, I have a list that contains names of some pipe assemblies but also names of some parts that are to be shipped individually.
    Does anyone know how to extract a list that would list the rows with assembly names once while listing all the rows that contain "shipped loose"?

    ex:
    Col A (original list) Col B (extracted list)

    assembly 1
    assembly 1
    shipped loose
    assembly 2
    assembly 2
    shipped loose

    Col B (extracted list)

    assembly 1
    assembly 2
    shipped loose
    shipped loose

    Thanks for any help!

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

    Re: Extract a list that allows specific value to have duplicates but not any other values.

    One way
    Sub test()
        Dim x
        With Range("a1", Range("a" & Rows.Count).End(xlUp))
            .Columns("b").ClearContents
            x = Filter(.Parent.Evaluate("transpose(if(" & .Address & "=""shipped loose""," & .Address & _
            ",if(countif(offset(" & .Address & ",0,0,row(1:" & .Rows.Count & "))," & .Address & ")=1," & _
            .Address & ",char(2))))"), Chr(2), 0)
            .Columns("b").Resize(UBound(x) + 1).Value = Application.Transpose(x)
        End With
    End Sub

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Stuarts Draft, VA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Extract a list that allows specific value to have duplicates but not any other values.

    Incredible (to me, anyway), thank you very much!

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

    Re: Extract a list that allows specific value to have duplicates but not any other values.

    You are welcome.

+ 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