Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fw:code needed
Is thereany news fo me? or mised something?
29.07.2003 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 -- Ibrahim OZEN |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fw:code needed
When doing it manually, you get a chance to select the criteria range each time apply the
filter. You sould be ablt to do the same in your code. On Mon, 4 Aug 2003 01:31:38 +0300, "ibo" wrote: Is thereany news fo me? or mised something? 29.07.2003 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fw:code needed
Thanks for response Mryna.
I added second sheet with same code changed criteria name and place it worked.Better than doing manually. "Myrna Larson" wrote in message ... When doing it manually, you get a chance to select the criteria range each time apply the filter. You sould be ablt to do the same in your code. On Mon, 4 Aug 2003 01:31:38 +0300, "ibo" wrote: Is thereany news fo me? or mised something? 29.07.2003 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA code needed | New Users to Excel | |||
Code Needed | New Users to Excel | |||
Help needed with VBA code | Excel Discussion (Misc queries) | |||
VBA code help needed | Excel Discussion (Misc queries) | |||
code needed | Excel Programming |