When you delete the row that contains the range czas
you also delete that range object. A null range has no property .value
which is why you are getting an object required error.
A good way to mass delete range object is to use union
to create non-contiguous ranges and then delete them all at once. This spares you the weirdness of shifting rows in a loop and also will significantly improve speed as deleting is pretty expensive.
Dim wb As Workbook
Dim c As Range
Dim zakres As Range
Dim zakres2 As Range
Dim ile As String
Dim czas As Range
Dim i As Long
Dim delrng As Range
Set wb = ThisWorkbook
Set czas = wb.Worksheets("Dane").Range("J2")
ile = Application.WorksheetFunction.CountA(wb.Worksheets("Dane").Range("L:L"))
For i = 1 To ile
If czas.Value < "00:01:00" Then
Set zakres = czas.Offset(0, 0)
Set zakres2 = czas.Offset(0, 2)
If delrng Is Nothing Then
Set delrng = Range(zakres, zakres2)
Else
Set delrng = Union(delrng, Range(zakres, zakres2))
End If
End If
Set czas = czas.Offset(1, 0)
Next i
If Not delrng Is Nothing Then
delrng.Delete
end if
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…