code needed

I

ibo

Hi

I am using advance filter as follow codes.

Criteria of sheet1 is defined as "Data!$Q$1:$R$2".
I want to add an other criteria as "Data!$S$1:$T$2" for sheet2 .
I mean I want to use first criteria for filter in sheet1 and second one for
sheet2.
Is it possible to select criteria according to sheets.



The Codes:
--------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 2 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Sheets("Data").Range("Criteria").Calculate
Worksheets("Data").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Data").Range("Criteria"), _
CopyToRange:=Range("A7:N7"), Unique:=False

End If
End Sub


Thanks for advance
Ibo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top