+ Reply to Thread
Results 1 to 5 of 5

copy unique value from column to another column

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    copy unique value from column to another column

    Hi All,

    Probably a very easy question, but couldn't find a thread similar to this.

    In column A I have weeknumbers (duplicates occur). In column C I want all unique weeknumbers from column A.
    Data in column A starts at cell A6, the blanks are not to be copied. Pasting in cell C2 downward. Column C then to be sorted smallest to largest.

    See attached file with the example data.

    What will need to be the VBA code to obtain the above?

    Thanks all for your input!
    Peter
    Attached Files Attached Files

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: copy unique value from column to another column

    Hi
    You can do this with the help of a helper column
    So in cell B2 put this
    =IFERROR(INDEX($A$6:$A$100,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$6:$A$100),0,0),0)),"")
    and copy down

    Now in C2 put this
    =IFERROR(SMALL($B$2:$B$100,ROW()),"")
    and copy down

    This works for 100 rows extend to suit requirement..
    Hope this helps!!
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: copy unique value from column to another column

    Give this a try:

    Please Login or Register  to view this content.
    Gary's Student

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy unique value from column to another column

    If the week days are numbers, try
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    Re: copy unique value from column to another column

    Ah perfect! You all helped me understand the VBA a bit better ;-)

    Case closed, stars earned!

+ 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] Count unique occurences in one column with unique occurances in another column
    By 21stCenturyLessons in forum Excel General
    Replies: 5
    Last Post: 07-12-2014, 08:44 AM
  2. [SOLVED] Macro to copy and paste only unique values from one column to another column in same sheet
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2014, 05:44 AM
  3. [SOLVED] How to copy rows to new worksheet based on unique first character in column
    By G-N-A in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2013, 12:43 PM
  4. [SOLVED] Macro to copy unique cells to another column
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2012, 04:36 PM
  5. [SOLVED] Macro to identify a unique value in a column to copy and paste value to another sheet
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2012, 07:59 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