+ Reply to Thread
Results 1 to 5 of 5

Need macro to look for values in one column and return them once in another column

  1. #1
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2016
    Posts
    122

    Need macro to look for values in one column and return them once in another column

    Hello,
    I am trying to get a macro to look in a column for all the different values and then return each value once in another column.

    For example, in column B the values are B1=Item1, B2=Item3, B3=Item1, B3=Item1, B4=Item3, B5=Item2, and so on...

    In column D, I would like to return all the different values only once. For example, D1=Item1, D2=Item2, D3=Item3, and so on...

    If someone can help me with this I would appreciate it.
    Thank you!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    8,231

    Re: Need macro to look for values in one column and return them once in another column

    No macro needed. Use advanced filter (just remember to have a header above your data. If it's not there, and real data starts in B1 - add one - for instance ;-) "dummy header".
    If you really opt for the macro:

    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2016
    Posts
    122

    Re: Need macro to look for values in one column and return them once in another column

    Quote Originally Posted by Kaper View Post
    No macro needed. Use advanced filter (just remember to have a header above your data. If it's not there, and real data starts in B1 - add one - for instance ;-) "dummy header".
    If you really opt for the macro:

    Please Login or Register  to view this content.
    Thank you very much! This works great

  4. #4
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2016
    Posts
    122

    Re: Need macro to look for values in one column and return them once in another column

    Kaper,

    I am not sure if this is possible, but with a similar macro, can I do the same thing but across all the sheets in my workbook without having to name each sheet? The number of sheets vary and the names are always different.

    In each sheet, the data I am looking up will always be in column B.

    Thank you again

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    8,231

    Re: Need macro to look for values in one column and return them once in another column


+ 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. Replies: 5
    Last Post: 08-01-2014, 04:31 AM
  2. Replies: 8
    Last Post: 02-13-2014, 11:30 AM
  3. Excel Macro To Return Column Values
    By MLS Packer Lover in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2011, 04:07 PM
  4. Macro button - check a column values and return msg box
    By jimjaix in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2009, 04:05 PM
  5. Replies: 3
    Last Post: 01-10-2006, 06:10 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