+ Reply to Thread
Results 1 to 5 of 5

Remove unique values within string

  1. #1
    Registered User
    Join Date
    07-16-2019
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    44

    Remove unique values within string

    Hi Excel Forum,

    I would like to create a macro that compares the values of two cells and outputs only the common values.

    For example:

    Cell A: "March April May June November December"
    Cell B: "April May June July"
    Cell C: "December March April"

    After comparing B, with A, and C with the common values of A and B, I should receive the following output in Cell D: "April"

    I have been pondering how to do this for months!

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Remove unique values within string

    maybe not vba but Power Query ?
    (tailored to your example)

    A B C Result
    March April May June November December April May June July December March April April
    Last edited by sandy666; 01-20-2023 at 03:52 AM.

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

    Re: Remove unique values within string

    Use in cell like
    =FindCommon(A1:C1)
    Please Login or Register  to view this content.
    Last edited by jindon; 01-20-2023 at 03:42 AM.

  4. #4
    Registered User
    Join Date
    07-16-2019
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    44

    Re: Remove unique values within string

    You're both fantastic; thank you very much!

    Jindon, I managed to tweak your code to work within VBA provided there were no empty values within the range:

    Please Login or Register  to view this content.
    Thank you again!

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

    Re: Remove unique values within string

    If you want to ignore empty cell(s) then change to
    Please Login or Register  to view this content.

+ 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. How to find duplicate values and remove unique values only
    By rompeer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-19-2022, 09:11 PM
  2. Remove multiple unique values
    By Insewa in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-26-2021, 05:58 AM
  3. Why can't I remove duplicates to leave unique values
    By Gary7558 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-07-2018, 12:40 PM
  4. Remove Duplicates With Unique Values
    By Videoman22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2015, 06:01 PM
  5. [SOLVED] Unique Values Without Remove Duplicates
    By Camel in forum Excel General
    Replies: 25
    Last Post: 07-20-2012, 04:17 AM
  6. Replies: 1
    Last Post: 05-24-2011, 04:04 AM
  7. Macro to remove duplicates values and keep unique values bases on multiple criteria
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2011, 04:37 PM

Tags for this Thread

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