Thank you Joseph, you are absolutely correct and now the first part of the process works fine to copy values into the crit1 and crit2 ranges. I thought I might be able to fix the macros that are called in the same manner so what I have come up with for the filtering process is
Sub dataextract()
'
' dataextract Macro
'
'
Dim ws As Worksheet
Set ws = Sheets("dataextract")
ws.Range("A11").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
ws.Range("criteria").Select
Range("datarange").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("criteria"), CopyToRange:=Range("outputrange"), Unique:=False
End Sub
but I have messed up somewhere along the line or specifying the work on the dataextract sheet, any ideas please ?
This is the macro before I messed with it, and it works fine when run from the dataextract sheet.
Sub dataextract()
'
' dataextract Macro
'
Range("A11").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Range("B2:C3").Select
Range("datarange").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("B2:C3"), CopyToRange:=Range("A10:i10"), Unique:=False
End Sub
as you can see, this is all quite new to me !
Bookmarks