I have the following code which is used to filter data according to 2 parameters entered by users in a userform...my problem comes when a usecode is entered that doesn't exist - users won't previously know which use codes are in the current month data. Because the usecode is not in this data the whole of the page is then copied into the other sheet - is there a way to stop this from happening?
Columns("a".Select
Selection.AUTOFILTER Field:=3, Criteria1:=Use_Code.Text
Range(Cells(2, 1), Cells(lRow, 26)).Interior.ColorIndex = xlNone
Selection.AUTOFILTER Field:=10, Criteria1:=Age2.Text
Range(Cells(2, 1), Cells(lRow, 26)).Interior.ColorIndex = xlNone
Range(Cells(2, 1), Cells(lRow, 26)).Copy
thanks again for you help
Columns("a".Select
Selection.AUTOFILTER Field:=3, Criteria1:=Use_Code.Text
Range(Cells(2, 1), Cells(lRow, 26)).Interior.ColorIndex = xlNone
Selection.AUTOFILTER Field:=10, Criteria1:=Age2.Text
Range(Cells(2, 1), Cells(lRow, 26)).Interior.ColorIndex = xlNone
Range(Cells(2, 1), Cells(lRow, 26)).Copy
thanks again for you help