Hello guys, here is my code. I receive the error when the filtered data isn't found. How will i be able to proceed if filtered data isn't found?
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=90000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo A
Else
rng.Select
Selection.Delete
End If
A:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=19000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo B
Else
rng.Select
Selection.Delete
End If
B:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=11000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo C
Else
rng.Select
Selection.Delete
End If
C:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=24000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo D
Else
rng.Select
Selection.Delete
End If
D:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=90000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo A
Else
rng.Select
Selection.Delete
End If
A:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=19000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo B
Else
rng.Select
Selection.Delete
End If
B:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=11000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo C
Else
rng.Select
Selection.Delete
End If
C:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17, Criteria1:= _
"=24000*", Operator:=xlAnd
If rng.Columns(1).SpecialCells(xlVisible).Count - 1 = 0 Then
GoTo D
Else
rng.Select
Selection.Delete
End If
D:
ActiveSheet.Range("$A$1:$AD$" & allRow).AutoFilter Field:=17