+ Reply to Thread
Results 1 to 6 of 6

removing rows having duplicate unique id

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    removing rows having duplicate unique id

    Range("AQ:AQ").AutoFilter 1, "False"
    Range("AQ2:AQ" & Cells(Rows.Count, 42).End(xlUp).Row).EntireRow.Delete

    I am using this code but i am not getting the desired results.As the rows with duplicate unique id still remains.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: removing rows having duplicate unique id

    Did you try using the remove duplicates option in excel 2007?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows having duplicate unique id

    I know about that but i want to automate it..using a vba code.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: removing rows having duplicate unique id

    Sure, just record your step while doing the remove duplicates step. You will get your code.

  5. #5
    Registered User
    Join Date
    04-26-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows having duplicate unique id

    Thanks..It was helpful.But again i am caught in a situation.I got the following code by recording
    Please Login or Register  to view this content.
    which i modified into
    Please Login or Register  to view this content.
    to make it more dynamic.but there is a error(run time error '1004') while using this code

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: removing rows having duplicate unique id

    Interchange these 2 - cells(Columns.Count, Rows.Count) It should be rows.count, columns.count)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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