Results 1 to 3 of 3

Find Duplicates if found clear specific cells

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Find Duplicates if found clear specific cells

    I have this macro that clears entire row when duplicates are found on column B so I would like to changed to where it only clear specific cells
    I will like to clear from cell 1 to 20 and cell 25
    Any help on this will greatly appreciated thank you for your time
    Sub ClearDupRows()
    Dim StartRow As Long
    Dim EndRow As Long
    Dim R As Long
    With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
    .EnableEvents = False
    End With
    StartRow = 1
    EndRow = Cells(StartRow, "B").End(xlDown).Row
    For R = EndRow To StartRow Step -1
    If Application.CountIf(Range(Cells(1, "B"), _
    Cells(R, "B")), Cells(R, "B").Value) > 1 Then
    Rows(R).Clear
    End If
    Next R
    With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
    .EnableEvents = True
    End With
    End Sub
    Last edited by martinez_pedro; 04-20-2011 at 12:19 PM.

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