Dowsey1977
08-05-2005, 05:38 AM
Hi,
I use the below code to filter a spreadsheet I have and copy to another sheet. I have just added some more rows (using a form - as I did for all rows of data), but the filter doesn't seem to want to pick up the new rows. I can filter on Size, type, name, manager and view all. Up until now these have all worked. I have added 3 new lines and size, type and manager bring back no rows if filter is asking for one of the 3 new rows, name works fine and view all just removes the 3 new lines. Any ideas why this might be??
Option Explicit
Sub Advanced_Filter()
Application.ScreenUpdating = False
Range("A1:K1").Select
Range(Selection, Selection.End(xlDown)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Criteria"), CopyToRange:=Range("Output!A11:K11"), Unique:=False
Sheets("Output").Select
Range("A12").Select
Sheets("DataSheet").Visible = False
If IsEmpty(Range("A12")) Then
MsgBox ("No Results Found Based On Your Search Criteria - Please Refine and Try Again!")
End If
Application.ScreenUpdating = True
End Sub
Many thanks in advance
I use the below code to filter a spreadsheet I have and copy to another sheet. I have just added some more rows (using a form - as I did for all rows of data), but the filter doesn't seem to want to pick up the new rows. I can filter on Size, type, name, manager and view all. Up until now these have all worked. I have added 3 new lines and size, type and manager bring back no rows if filter is asking for one of the 3 new rows, name works fine and view all just removes the 3 new lines. Any ideas why this might be??
Option Explicit
Sub Advanced_Filter()
Application.ScreenUpdating = False
Range("A1:K1").Select
Range(Selection, Selection.End(xlDown)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Criteria"), CopyToRange:=Range("Output!A11:K11"), Unique:=False
Sheets("Output").Select
Range("A12").Select
Sheets("DataSheet").Visible = False
If IsEmpty(Range("A12")) Then
MsgBox ("No Results Found Based On Your Search Criteria - Please Refine and Try Again!")
End If
Application.ScreenUpdating = True
End Sub
Many thanks in advance