Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default AutoFilter based on 2 Fields and 2 Criteria?

Is it possible to AutoFilter based on adjacent cells with complementing
criteria?

For instance, I have values in row x, columns y and z. And I need to
see if x,y < Minimum and x,z Maximum is this possible?


Here's what I have right now:

'Is Val_Min between limits? (Column 17)
Sheets(sName).Cells(17, 1).AutoFilter Field:=17, _
Criteria1:="=" & Min_Limit, Operator:=xlAnd, Criteria2:="<=" &
Max_Limit

'Is Val_Max between limits? (Column 18)
Sheets(sName).Cells(18, 1).AutoFilter Field:=18, _
Criteria1:="=" & Min_Limit, Operator:=xlAnd, Criteria2:="<=" &
Max_Limit

'Is Val_Min below Min_Limit AND Val_Max above Max_Limit? (Column 17
and 18)
????


Sheets(sName).UsedRange.SpecialCells(xlCellTypeVis ible).Copy

Sheets.Add().Name = strName
ActiveSheet.Paste



Thanks,
Logan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default AutoFilter based on 2 Fields and 2 Criteria?


DISMfish wrote:
Is it possible to AutoFilter based on adjacent cells with complementing
criteria?

For instance, I have values in row x, columns y and z. And I need to
see if x,y < Minimum and x,z Maximum is this possible?


Here's what I have right now:

'Is Val_Min between limits? (Column 17)
Sheets(sName).Cells(17, 1).AutoFilter Field:=17, _
Criteria1:="=" & Min_Limit, Operator:=xlAnd, Criteria2:="<=" &
Max_Limit

'Is Val_Max between limits? (Column 18)
Sheets(sName).Cells(18, 1).AutoFilter Field:=18, _
Criteria1:="=" & Min_Limit, Operator:=xlAnd, Criteria2:="<=" &
Max_Limit

'Is Val_Min below Min_Limit AND Val_Max above Max_Limit? (Column 17
and 18)
????


Sheets(sName).UsedRange.SpecialCells(xlCellTypeVis ible).Copy

Sheets.Add().Name = strName
ActiveSheet.Paste



Thanks,
Logan


In my limited experience, you need a Custom Filter to filter on more
than one field at a time.

Hope this helps in your world.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default AutoFilter based on 2 Fields and 2 Criteria?

How do you make a custom filter in vb?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default AutoFilter based on 2 Fields and 2 Criteria?


DISMfish wrote:
How do you make a custom filter in vb?


Best way to start is to make one while while you record a macro, then
modify it to your needs. You don't have to actually create the Criteria
fields, they can already be there and you just select them while
recording the macro.

Hope this helps.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default AutoFilter based on 2 Fields and 2 Criteria?

Thanks. It looks like I can't use it anyway. I need to sort by
several fields and the autofilter will only AND them to the visible
list if true. I need to OR them to the visible list for each
autofilter run.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default AutoFilter based on 2 Fields and 2 Criteria?

I had the similiar problem usinghe advance filter I set the criteria range
up like this Note it is 3 columns:

A B C
1 CORRECTION_NUM M0090_INFO_COMPLETED_DT M0090_INFO_COMPLETED_DT

2 <99 01/01/2005
<12/31/2005

3 01/01/2005
12/31/2005


The key here is in columns b c rows 2 and 3 function as an 'OR'

I got my help from http://www.contextures.com/xladvfilter02.html as directed
by these illustrious teachers to the world

Hope it helps

--
Wendell A. Clark, BS
-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.


"DISMfish" wrote in message
oups.com...
Thanks. It looks like I can't use it anyway. I need to sort by
several fields and the autofilter will only AND them to the visible
list if true. I need to OR them to the visible list for each
autofilter run.



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
SUM up multiple fields based on Criteria Andi Excel Discussion (Misc queries) 3 September 18th 09 01:41 PM
Formula to count based on multiple criteria fields w/duplicates Excel-User-RR Excel Worksheet Functions 5 March 8th 09 12:48 AM
Calculated Fields Based on Running Total Fields? Kruncher Excel Programming 0 May 12th 06 06:40 PM
Calculated Fields Based on Running Total Fields? Kruncher Excel Programming 0 May 12th 06 06:18 PM
Autofilter criteria based on cell value Craig[_2_] Excel Programming 1 June 30th 05 04:20 PM


All times are GMT +1. The time now is 09:19 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"