Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GLT GLT is offline
external usenet poster
 
Posts: 12
Default Custom Filter using more than two 'OR'

Hi,

I am trying to run a custom filter on a column, returning results if any of
three values are found in a cell.

For example, if "MO" or "TU" or "WE" are found.

However this function will not support more than one 'OR' in the code.

This is the code I tried to use:

Selection.AutoFilter Field:=1, Criteria1:="=ALL", Operator:=xlOr, _
Criteria2:="=" & myDay2, Operator:=x1or, Criteria3:="= MT"

Is this how this Autofilter is setup to work (only one 'OR') or is my code
wrong?

Any assistance would be greatly appreciated.

Thanks,
GLT.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Custom Filter using more than two 'OR'

Yes, it only supports two criteria.

You will either need to us an advanced filter or put in a dummy column that
has a formula that determines if the row should be visible or not and filter
on that column.

--
Regards,
Tom Ogilvy


"GLT" wrote in message
...
Hi,

I am trying to run a custom filter on a column, returning results if any

of
three values are found in a cell.

For example, if "MO" or "TU" or "WE" are found.

However this function will not support more than one 'OR' in the code.

This is the code I tried to use:

Selection.AutoFilter Field:=1, Criteria1:="=ALL", Operator:=xlOr, _
Criteria2:="=" & myDay2, Operator:=x1or, Criteria3:="= MT"

Is this how this Autofilter is setup to work (only one 'OR') or is my code
wrong?

Any assistance would be greatly appreciated.

Thanks,
GLT.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Custom Filter using more than two 'OR'

Also,

On this I have found the Database functions to be very useful:-
=DSUM =DSUMIF, etc.

somethinglikeant

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Custom Filter using more than two 'OR'

The advanced filter is the filtering equivalent to the D functions (there is
no DSUMIF I am aware of).

--
Regards,
Tom Ogilvy


"somethinglikeant" wrote in message
oups.com...
Also,

On this I have found the Database functions to be very useful:-
=DSUM =DSUMIF, etc.

somethinglikeant



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Custom Filter using more than two 'OR'

Apologies Tom



  #6   Report Post  
Posted to microsoft.public.excel.programming
GLT GLT is offline
external usenet poster
 
Posts: 12
Default Custom Filter using more than two 'OR'

Hi Tom,

How do I set up an advanced filter in VBA?

I tried to do it via the help and I can't make any sense out of it ...

Chrees

"Tom Ogilvy" wrote:

Yes, it only supports two criteria.

You will either need to us an advanced filter or put in a dummy column that
has a formula that determines if the row should be visible or not and filter
on that column.

--
Regards,
Tom Ogilvy


"GLT" wrote in message
...
Hi,

I am trying to run a custom filter on a column, returning results if any

of
three values are found in a cell.

For example, if "MO" or "TU" or "WE" are found.

However this function will not support more than one 'OR' in the code.

This is the code I tried to use:

Selection.AutoFilter Field:=1, Criteria1:="=ALL", Operator:=xlOr, _
Criteria2:="=" & myDay2, Operator:=x1or, Criteria3:="= MT"

Is this how this Autofilter is setup to work (only one 'OR') or is my code
wrong?

Any assistance would be greatly appreciated.

Thanks,
GLT.




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
Auto filter custom filter stevefromnaki Excel Worksheet Functions 2 December 30th 09 06:23 AM
Custom filter BNT1 via OfficeKB.com Excel Discussion (Misc queries) 4 May 29th 09 02:49 PM
Custom Filter Pop-up Box Jmes Excel Worksheet Functions 1 November 20th 08 03:40 PM
Custom Filter Rao Ratan Singh New Users to Excel 3 June 16th 06 01:36 PM
Custom Filter Rob Excel Discussion (Misc queries) 18 April 5th 06 03:49 PM


All times are GMT +1. The time now is 06:05 PM.

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

About Us

"It's about Microsoft Excel"