Advanced Autofilter not working
I have a form with comboboxes and textboxes that collect the user's search criteria. the function WriteValues2CritRng then assigns those values to a range defined as "rgCriteria", which has as its first line the row headers. My rgExtract also has row headers as its first line.
I copied the code from page 173 of the book (adding the line for the function WriteValues2CritRng:
Private Sub cmdSearch_Click()
Dim rgDB As Range
Dim rgCriteria As Range
Dim rgExtract As Range
Set rgDB = Range("Database")
Set rgCriteria = Range("Criteria")
Set rgExtract = Range("Extract")
WriteValues2CritRng
rgDB.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=rgCriteria, _
CopyToRange:=rgExtract
End Sub
The code runs fine, no errors or anything, but no rows are extracted. I don't have a clue as to how to go about debugging this. Any ideas? Thanks.
--elizabeth
|