+ Reply to Thread
Results 1 to 8 of 8

VBA code Help- keeping only first unique value

  1. #1
    Registered User
    Join Date
    06-07-2021
    Location
    india
    MS-Off Ver
    2011
    Posts
    39

    VBA code Help- keeping only first unique value

    Hi

    looking VBA code for Keeping only first unique rows

    in column B & C have some information
    Column C having duplicate content
    I want to keep only first unique value of column C like as image
    result comes with like by line

    ie: deleting in between red color values , next red color row comes to B2C2 ,B3C3 likes as

    test_unique.PNG

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA code Help- keeping only first unique value

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-07-2021
    Location
    india
    MS-Off Ver
    2011
    Posts
    39

    Re: VBA code Help- keeping only first unique value

    information in only B &C , Activesheet.cells means entire sheet duplicate removed , I tried below not working please help me.

    Sub DeleteDups()
    ActiveSheet.Columns("B:C").RemoveDuplicates Columns:=3, Header:=xlNo
    End Sub

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA code Help- keeping only first unique value

    Try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-07-2021
    Location
    india
    MS-Off Ver
    2011
    Posts
    39

    Re: VBA code Help- keeping only first unique value

    Before removing duplicate, I want to extract only two times repeated values from column B to column D please help

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA code Help- keeping only first unique value

    I'm sorry but I don't understand what you want to do. Please explain in detail referring to specific cells, rows and columns using a few examples from your data. Also attach a copy of your file (de-sensitized if necessary) that shows your expected result. See the yellow banner at the top of this page for instructions to attach a file.

  7. #7
    Registered User
    Join Date
    06-07-2021
    Location
    india
    MS-Off Ver
    2011
    Posts
    39

    Re: VBA code Help- keeping only first unique value

    The above code is working fine thanks
    I having another addon help.I'm my first post have image attched in that image coloumn B Having same values comes multiple times for Pls assume example B1 and B5 same vlaue its 5 times repeated. I want the results only 5 times repeated values should be extracted to D COLOUMN the extracted value should be unique. please help to solve this

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA code Help- keeping only first unique value

    Please see my response and request in Post #6.

+ 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. Merging duplicates and keeping unique
    By hiswillbedun in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2016, 01:06 PM
  2. Replies: 1
    Last Post: 01-29-2015, 04:08 PM
  3. How can I transpose my data keeping a unique ID
    By frankyy72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2013, 09:32 PM
  4. [SOLVED] Keeping the first and last rows of every unique value
    By Newby2012 in forum Excel General
    Replies: 15
    Last Post: 12-03-2012, 05:59 AM
  5. Merging names that are not unique while keeping their corresponding data
    By fredman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2009, 03:29 PM
  6. Merging unique ID while keeping their corresponding data
    By johnny1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2009, 03:46 PM
  7. Keeping track of unique strings in a column
    By praame in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-05-2007, 05:28 AM

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