+ Reply to Thread
Results 1 to 7 of 7

Macro To Delete Entire Row If Dublicate Is Found

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Macro To Delete Entire Row If Dublicate Is Found

    I have a work sheet called (waste data) what i am after is a Macro that will delete an entire row if the data in A, B & G is dublicated anywhere on the entire sheet

    Lets say

    A1 = 5 B1 = Jim G1 = Na41

    A21 = 5 B21 = Jim G21 = Na41

    Row 21 will be deleted as the same data is repeated in Row1

    The same data will be repeated more that once in A, B & G, in this case it will delete them

    Thanks

  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: Macro To Delete Entire Row If Dublicate Is Found

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button
    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
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro To Delete Entire Row If Dublicate Is Found

    Hi Arlu

    I have tried your code but keep getting an error, I have inserted a sample sheet for you to look at if you don't mind? The last 2 entries on this sheet are dublicates and one should be deleted

    Thanks for the help
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro To Delete Entire Row If Dublicate Is Found

    Hi SilverFox,

    See how this goes:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

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

    Re: Macro To Delete Entire Row If Dublicate Is Found

    What error do you get and which code line is highlighted?

  6. #6
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro To Delete Entire Row If Dublicate Is Found

    Hi Trevor thanks very much for this it worked first time, Arlu thanks also, the error i was getting was syntax error, not sure why. Thanks again guys. Problem Solved

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro To Delete Entire Row If Dublicate Is Found

    Thanks for letting us know and you're welcome.

+ 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