#1   Report Post  
Posted to microsoft.public.excel.programming
ibo ibo is offline
external usenet poster
 
Posts: 3
Default code needed

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code needed ernie New Users to Excel 1 March 19th 10 12:45 PM
Code Needed John Calder New Users to Excel 10 July 15th 09 11:42 PM
Help needed with VBA code Sam Hill Excel Discussion (Misc queries) 1 May 9th 06 02:29 PM
VBA code help needed Martin Excel Discussion (Misc queries) 3 April 28th 06 09:28 AM
VLOOKUP code needed please j4ymf Excel Worksheet Functions 4 March 12th 06 07:48 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"