+ Reply to Thread
Results 1 to 5 of 5

Remove Duplicates - Column A

  1. #1
    Registered User
    Join Date
    07-20-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    15

    Remove Duplicates - Column A

    I'm going to lose my mind on this one...

    I just need a simple code for removing duplicate values that are contained in the first column. It needs to be VBA for a larger project.

    I recorded the following:

    ActiveSheet.Range("TableXXXX[#All]").RemoveDuplicates Columns:=1, Header:=x1Yes

    When I go back in to run it, it comes up with runtime error... Not sure if it's because of the sheet name - the sheet name will change day over day. The entire range is approximately A1:CU250

    Thank you,

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Remove Duplicates - Column A

    .

    Not certain I understand the Sheet Name changing but this will work if the sheet with the dupes is the "active sheet" (the one you are viewing at the time). Also, if you want to remove
    all the blank cells (not the rows, just the cells in Col A), include the second macro as well:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-20-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    15

    Re: Remove Duplicates - Column A

    Thanks for the help; but I copied pasted the below and still get the 1004 runtime error. I also tried changing the header to "Yes" because it does have a header. There will never be a blank in column A so I don't need the additional VBA.

    Thank you,

    Columns("A:A").Select
    ActiveSheet.Range("$A:$B").RemoveDuplicates Columns:=1, Header:=xlNo

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Remove Duplicates - Column A

    .
    Hmmm ....

    Post your workbook here for review ? Leave out any confidential information.

  5. #5
    Registered User
    Join Date
    07-10-2017
    Location
    Philippines
    MS-Off Ver
    MS OFFICE 2016
    Posts
    38

    Re: Remove Duplicates - Column A

    Try this.

    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. [SOLVED] remove duplicates in column
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-11-2015, 10:33 AM
  2. Remove Duplicates in column and remove blanks
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2015, 07:25 AM
  3. Replies: 5
    Last Post: 05-08-2014, 07:24 AM
  4. remove duplicates in column
    By MsLilly in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2009, 01:08 PM
  5. How to remove duplicates from a column
    By LLocal in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-13-2009, 05:44 PM
  6. Remove duplicates in column D
    By maxebi in forum Excel General
    Replies: 3
    Last Post: 03-02-2009, 02:36 AM
  7. How to remove duplicates from a column
    By wali in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-14-2008, 11:33 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