Results 1 to 4 of 4

Delete Duplicated rows

Threaded View

lefty55 Delete Duplicated rows 04-25-2008, 05:12 PM
mrice Try this amended macro ... 04-26-2008, 12:52 PM
martindwilson try asap utilities add in... 04-27-2008, 04:59 AM
lefty55 thank you mrice. this solved... 04-28-2008, 06:25 PM
  1. #1
    Registered User
    Join Date
    04-25-2008
    Location
    Alabama
    Posts
    2

    Delete Duplicated rows

    http://help.lockergnome.com/office/d...ct1003548.html
    above is cross-link to First post. Sorry I didn't find this forum first. I am somewhat green with everything but basic excel.
    I have a spreadsheet with columns A through F. Column "C" is an invoice # and is listed multiple times, depending on the number of items billed on this invoice. I'm trying to delete all multiple copies of this invoice leaving only the first instance of each (the first entry has the total sale). I found a macro on a forum from a while back and it will delete my duplicate invoices if I insert my invoice # to Column "A", but it get's my other columns out of sync. I think this macro was written for a two column spreadsheet. Here is the Macro that almost works:
    Sub DeleteDupes() 
    Dim Iloop As Integer 
    Dim Numrows As Integer 
    
    'Turn off warnings, etc. 
    Application.ScreenUpdating = False 
    Application.DisplayAlerts = False 
    
    Numrows = Range("A65536").End(xlUp).Row 
    Range("A1:B" & Numrows).Select 
    Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, _ 
    Key2:=Range("B1"), Order2:=xlAscending, Header:=xlYes, _ 
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom 
    For Iloop = Numrows To 2 Step -1 
    If Cells(Iloop, "A") + Cells(Iloop, "B") = Cells(Iloop - 1, "A") + _ 
    Cells(Iloop - 1, "B") Then 
    Rows(Iloop).Delete 
    End If 
    Next Iloop 
    
    'Turn on warnings, etc. 
    Application.DisplayAlerts = True 
    Application.ScreenUpdating = True 
    End Sub
    I'm not familiar enough with Macros to know how to adapt this. Any help would be greatly appreciated.
    Marv
    Last edited by Leith Ross; 04-25-2008 at 07:28 PM. Reason: Corrected user typo with code tags

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