I am creating a macro to delete rows based on a duplicate value in column E (see code below). However, there are times that I signify a blank cell with "--", in these instances I would like to not delete those rows because there is other information that is needed. Thanks for your help in advance.
Private Sub RemoveDuplicateRowsSR()
Dim rCell As Range
Dim rRange As Range
Dim lCount As Long
Set rRange = Range("E8", Range("E" & Rows.Count).End(xlUp))
lCount = rRange.Rows.Count
For lCount = lCount To 1 Step -1
With rRange.Cells(lCount, 1)
If WorksheetFunction.CountIf(rRange, .Value) > 1 Then
.EntireRow.Delete
End If
End With
Next lCount
End Sub
Bookmarks