Hi,
I have the below code and it currently causes an error when nothing is found in the filter, could someone advise me how to ignore this error and move straight to Call test_9 if nothing is found.
I think an "On Error GoTo" will solve this for me but I am not sure where to place this in my code.
I have the below code and it currently causes an error when nothing is found in the filter, could someone advise me how to ignore this error and move straight to Call test_9 if nothing is found.
I think an "On Error GoTo" will solve this for me but I am not sure where to place this in my code.
VBA Code:
Dim R As Range, rng As Range
Set R = Range("A1").CurrentRegion
Set rng = R.Offset(1, 14).Resize(R.Rows.Count - 1) 'This is all the data w/o the headers
Sheets("Test1").Select
With ActiveSheet
If .AutoFilterMode Then .AutoFilterMode = False
.Range("A1:AK1").AutoFilter 14, Criteria1:=Array( _
"Refund"), Operator:=xlFilterValues
Set rng = rng.SpecialCells(xlCellTypeVisible)
rng.Select
rng.Copy
End With
Sheets("Test2").Select
Range("A:A").Find("").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Test_9