Chcę usunąć wszystkie wiersze zawierające #REF
w kolumnie A.
Mój kod działa tylko z value
i nie działa z #REF
.
Dim varFindThis As Variant
Dim rngLookIn As Range
Dim f As String
varFindThis = Worksheets("Suivi2").Range("B1")
Set rngLookIn = Worksheets("Suivi2").Range("A:A")
If Not rngLookIn.Find(varFindThis, LookIn:=xlValues) Is Nothing Then
f = Worksheets("Suivi2").Range("B1").Value
"Since i didn"t got that clear, here above you must create a code to declare "f" as whatever you want
Set c = Worksheets("Suivi2").Range("A:A").Find(f)
Worksheets("Suivi2").Range(c.Address).EntireRow.Delete
End If
Odpowiedzi:
0 dla odpowiedzi № 1Możesz użyć Metoda Range.SpecialCells szybko zlokalizować wszystkie błędy w Właściwość Worksheet.UsedRange.
on error resume next
with Worksheets("Suivi2").Columns(1)
if not .specialcells(xlCellTypeFormulas, xlErrors) is nothing then _
.specialcells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
end with
on error goto 0