Results 1 to 10 of 10

Modify to Run On Specific Column and Remove trailing digits in string

Threaded View

  1. #1
    Registered User
    Join Date
    08-01-2011
    Location
    Rome, Georgia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Modify to Run On Specific Column and Remove trailing digits in string

    I have a sheet that has an identifier like 1325686468.2958 on each line of column H. The digits leading up to the "." are the one's that matter to me. I need to keep 1 entry for each unique identifier. I have a macro that I picked up that deletes the entire row based on duplicates in the selected column which is great but I need it modified to first eliminate the 4 trailing digits. Also, this identifier will always be in column H, can i make it run there everytime instead of having to select that column first? Any help would be greatly appciated.

    Sub RemoveDupes2()
    Dim LR As Long
    Dim COL As Long
    
    COL = ActiveCell.Column
    LR = Cells(Rows.Count, COL).End(xlUp).Row
    
    With Range(Cells(1, Columns.Count), Cells(LR, Columns.Count))
        .FormulaR1C1 = "=IF(COUNTIF(R1C" & COL & ":RC" & COL & ",RC" & COL & ")=COUNTIF(C" & COL & ",RC" & COL & "), 1, """")"
        .SpecialCells(xlCellTypeFormulas, 2).EntireRow.Delete xlShiftUp
        .ClearContents
    End With
    
    End Sub
    Last edited by pmterp; 01-13-2012 at 12:28 AM.

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