A
Arno
Hello,
Is there a way to delete row/s that contain all cells with the same
text/element as the row above ?
I tried this syntax but I get run time error 13 - type mismatch
If c.Value <> c.Offset(-1, 0).Value Then FOR THIS LINE I GET THE DEBUGGER
Sub delMatchedRows()
Dim lr As Long, x As Long
Dim c As Range
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
For Each c In Rows(i).Cells
If c.Value <> c.Offset(-1, 0).Value Then HERE I GET THE DEBUGGER
x = x + 1
End If
Next
If x = 0 Then
Rows(i).Delete
End If
x = 0
Next
End Sub
Thank you !!
Is there a way to delete row/s that contain all cells with the same
text/element as the row above ?
I tried this syntax but I get run time error 13 - type mismatch
If c.Value <> c.Offset(-1, 0).Value Then FOR THIS LINE I GET THE DEBUGGER
Sub delMatchedRows()
Dim lr As Long, x As Long
Dim c As Range
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
For Each c In Rows(i).Cells
If c.Value <> c.Offset(-1, 0).Value Then HERE I GET THE DEBUGGER
x = x + 1
End If
Next
If x = 0 Then
Rows(i).Delete
End If
x = 0
Next
End Sub
Thank you !!