+ Reply to Thread
Results 1 to 11 of 11

Extract unique items from array and place in a column.

  1. #1
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Extract unique items from array and place in a column.

    Hello everyone. New user here.

    I have been doing quite a bit of research and have found many supposed VBA module codes that should work but I can not get them to work for the life of me.

    Here is a brief rundown of what I am attempting to do (I currently need help with step 2):
    1. Take a string separated with commas and extract each value to its own cell. I accomplished this with the following formula =TRIM(MID(SUBSTITUTE('MEAL CABLE SCHEDULE'!$L2,",",REPT(" ",LEN('MEAL CABLE SCHEDULE'!$L2))),(1-1)*LEN('MEAL CABLE SCHEDULE'!$L2)+1,LEN('MEAL CABLE SCHEDULE'!$L2))).
    2. Take the array produced by the formula above and extract a list of all unique values.
    3. Eventually take the list of unique values and use them to back reference other values from the spreadsheet.


    I have attempted to use ideas from the following link but apparently i cant post a link yet so I guess you have to use your imagination....

    Can anyone help? Thanks in advance!!
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Extract unique items from array and place in a column.

    Hi & welcome to the board.
    Could you please supply a copy of your workbook rather than an image.

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

  3. #3
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Re: Extract unique items from array and place in a column.

    Here you go and thanks!
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Extract unique items from array and place in a column.

    Thanks for the file.
    How about
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Re: Extract unique items from array and place in a column.

    Fluff...that is awesome and does work!

    One question I have is whether or not it is possible to build this into a module that that it will update in real time as the data is manipulated. Say someone modifies a string...the separate strings page will update and then the find unique items will update. Hitting the macro button isn't a big deal but something that is constantly updating itself would be awesome.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Extract unique items from array and place in a column.

    This needs to go in the "Strings" sheet module
    Please Login or Register  to view this content.
    Whenever a value in col L of that sheet changes the list will rebuild

  7. #7
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Re: Extract unique items from array and place in a column.

    Awesome! Thank you so much!

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Extract unique items from array and place in a column.

    Glad to help & thanks for the feedback

  9. #9
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Re: Extract unique items from array and place in a column.

    Fluff13, I have two more questions for you if you have the time. One is probably very simple and the other is fairly complex (might be a good brainteaser for you).

    1) (Easy) Is it possible to modify the VBA coding that you provided so that the unique output is sorted alphabetically?

    2) (Complex) I would like to take the list of unique entries, find where those unique entries appear in the L column of the strings sheet and return the entries in column C and D (of the strings sheet) in each row where it finds a match. It would also be amazing if this could automatically update the way you were able to get the unique list to automatically update.

    I have attached two pictures to better explain what I am asking for.

    Capture4.PNG
    The magenta and green highlights represent unique entries from the unique list. The yellow highlights represent data that needs to be pulled (yes I realize that I missed an entry or two haha).

    Capture3.PNG
    This image shows the format of the output I am hoping to achieve. Every time it finds an entry and creates a line showing the unique entry and then the data from columns C and D next to it.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Extract unique items from array and place in a column.

    This will sort the output
    Please Login or Register  to view this content.
    And you will need to start a new thread, for your other question.

  11. #11
    Registered User
    Join Date
    09-14-2018
    Location
    Minnesota
    MS-Off Ver
    2016
    Posts
    14

    Re: Extract unique items from array and place in a column.

    TY, on it!

+ 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. [SOLVED] Extract unique items from column and store some related data
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-05-2018, 08:15 AM
  2. [SOLVED] Calculate the total of a unique item and place in column G and make remaining items 0
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2015, 04:00 PM
  3. Replies: 1
    Last Post: 11-05-2015, 03:18 PM
  4. [SOLVED] Count Unique Items in a Column Based on Unique Items in Two Other Columns
    By HangMan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2015, 04:48 PM
  5. [SOLVED] Extract unique items based on criteria
    By YasserKhalil in forum Excel General
    Replies: 4
    Last Post: 09-03-2015, 03:29 AM
  6. Extract unique items from a Table and place in a column
    By Evilshrew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2007, 02:36 AM
  7. Extract Unique Items
    By GreenLotus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2007, 09:00 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