S
Snuffwinkler
Hi
I'm using the advanced filter in place to filter a list based on
certain criteria and then copying the filter result into another
worksheet. It works OK if there is data matching the criteria but if
there is no matching data it copies the whole of the "list range".
Any help on how I can prevent this would be gratefully received.
'FILTERS THE IMPORTED DATA FOR THE REFERENCE NUMBERS AT EACH
DIVISION LEVEL
Criterion.Clear
FilterForLevels.FormulaR1C1 = "=LEN(R[6]C)=" & LenLevel_1 & ""
Sheets("Import Area").Select
Database.Select
Selection.AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:=Range("A3:B4"), Unique:=False
Sheets("Level_1").Select
Range("a4:e6000").Clear
Sheets("Import Area").Select
RefNumbers.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Level_1").Select
Range("a4").Select
ActiveSheet.Paste
I'm using the advanced filter in place to filter a list based on
certain criteria and then copying the filter result into another
worksheet. It works OK if there is data matching the criteria but if
there is no matching data it copies the whole of the "list range".
Any help on how I can prevent this would be gratefully received.
'FILTERS THE IMPORTED DATA FOR THE REFERENCE NUMBERS AT EACH
DIVISION LEVEL
Criterion.Clear
FilterForLevels.FormulaR1C1 = "=LEN(R[6]C)=" & LenLevel_1 & ""
Sheets("Import Area").Select
Database.Select
Selection.AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:=Range("A3:B4"), Unique:=False
Sheets("Level_1").Select
Range("a4:e6000").Clear
Sheets("Import Area").Select
RefNumbers.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Level_1").Select
Range("a4").Select
ActiveSheet.Paste