2012-04-25 01:00:04 UTC
I need an Excel macro to delete duplicates from another sheet.....let me explain.....
I am working on sheet1 and i want to run that macro from same sheet but duplicate entries should be deleted from sheet2..........
i have a macro but it doesn't work from another sheet, means if i run this macro so it will delete duplicates from active worksheet only.......but i want to delete duplicates from another worksheet not from my working sheet.......plz plz plz hellllllllllpppppppppp......:(
I am using this macro:
Sub DeleteDups_B()
Dim LastRow
LastRow = Range("B" & _
ActiveSheet.Rows.Count).End(xlUp).Row
For Each cell In Range("B2:B" & LastRow)
cell.Select
If Application.CountIf(Range("B2:B" & LastRow), _
LCase(ActiveCell.Value)) > 1 Or _
Application.CountIf(Range("B2:B" & LastRow), _
UCase(ActiveCell.Value)) > 1 Or _
Application.CountIf(Range("B2:B" & LastRow), _
Application.Proper(ActiveCell.Value)) > 1 Then
ActiveCell.EntireRow.Delete
End If
Next
End Sub
Plz help friends.....