Hi all,
I have names of our employees in column A that is being populated from another spreadsheet using "If" formulae. I need to delete the duplicate entries and also delete the row. For this I am trying the following VBA code, but running into problems. The code is stopping at the "Lastrow" line with a run-time error message 438- "object doesn't support this property or method". Any help would be greatly appreciated.
Also I would like to delete the rows with blanks in this column.
Sub DelDuplicates()
Dim lastrow As Long, fnd As Variant, loop_ctr As Integer
With Sheets("Bonus Calculation")
For loop_ctr = 3 To 100
lastrow = Cells(Rows.Count, .Column(1)).End(xlUp).Row
fnd = Application.Match(.Range("A" & loop_ctr).Value, Range(Cells(.Row + 1, .Column), Cells(lastrow, .Column)), 0)
If Not IsError(fnd) Then
.Range("A" & loop_ctr).Rows("1:1").EntireRow.Delete Shift:=xlUp
End If
Next loop_ctr
End With
End Sub
Bookmarks