Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default filter criteria

On auto filter,usually there is a criteria '(All)'.What
is the match word in the vba to represent '(All)' to
show all records?

here is my filter
SourceRange.AutoFilter Field:=7, _
Criteria1:="=" & WS.Range("A10").Value

I tried to add word (All) but it returns no record.
Thnk's

Rgds,

Shiro



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default filter criteria

Simply
SourceRange.AutoFilter Field:=7

Recording operations as a macro easily answers most questions of this kind.
Try it!

Regards,
Stefi

€˛shiro€¯ ezt Ć*rta:

On auto filter,usually there is a criteria '(All)'.What
is the match word in the vba to represent '(All)' to
show all records?

here is my filter
SourceRange.AutoFilter Field:=7, _
Criteria1:="=" & WS.Range("A10").Value

I tried to add word (All) but it returns no record.
Thnk's

Rgds,

Shiro




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default filter criteria

Hi Stefi,
The user is not interact directly with the VBA editor.
May be we enable to view the code and change
the code directly,but in my case,the user input about
5 criterias in the worksheets cells by selecting them
from a dropdown list.And I was unable to find the value
that represent criteria '(All)' for the filter criteria.


"Stefi" wrote in message
...
Simply
SourceRange.AutoFilter Field:=7

Recording operations as a macro easily answers most questions of this

kind.
Try it!

Regards,
Stefi

"shiro" ezt ķrta:

On auto filter,usually there is a criteria '(All)'.What
is the match word in the vba to represent '(All)' to
show all records?

here is my filter
SourceRange.AutoFilter Field:=7, _
Criteria1:="=" & WS.Range("A10").Value

I tried to add word (All) but it returns no record.
Thnk's

Rgds,

Shiro






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default filter criteria

I'm not sure I understand your problem. Criterium '(All)' is represented in
VBA by no Criteria value:

SourceRange.AutoFilter Field:=7

Regards,
Stefi

€˛shiro€¯ ezt Ć*rta:

Hi Stefi,
The user is not interact directly with the VBA editor.
May be we enable to view the code and change
the code directly,but in my case,the user input about
5 criterias in the worksheets cells by selecting them
from a dropdown list.And I was unable to find the value
that represent criteria '(All)' for the filter criteria.


"Stefi" wrote in message
...
Simply
SourceRange.AutoFilter Field:=7

Recording operations as a macro easily answers most questions of this

kind.
Try it!

Regards,
Stefi

"shiro" ezt Ć*rta:

On auto filter,usually there is a criteria '(All)'.What
is the match word in the vba to represent '(All)' to
show all records?

here is my filter
SourceRange.AutoFilter Field:=7, _
Criteria1:="=" & WS.Range("A10").Value

I tried to add word (All) but it returns no record.
Thnk's

Rgds,

Shiro







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default filter criteria

Here's VB code that will let the user pick "(All)" from a dropdown box and
have the filter work like you mentioned.

If Worksheets("Input").Range("E26").Value = "(All)" Then
Selection.AutoFilter _
Field:=2
Else:
Selection.AutoFilter _
Field:=2, _
Criteria1:=ThisWorkbook.Worksheets("Input").Range( "E26").Value, _
Operator:=xlAnd
End If

Hope that makes sense but it worked for me.

"Stefi" wrote:

I'm not sure I understand your problem. Criterium '(All)' is represented in
VBA by no Criteria value:

SourceRange.AutoFilter Field:=7

Regards,
Stefi

€˛shiro€¯ ezt Ć*rta:

Hi Stefi,
The user is not interact directly with the VBA editor.
May be we enable to view the code and change
the code directly,but in my case,the user input about
5 criterias in the worksheets cells by selecting them
from a dropdown list.And I was unable to find the value
that represent criteria '(All)' for the filter criteria.


"Stefi" wrote in message
...
Simply
SourceRange.AutoFilter Field:=7

Recording operations as a macro easily answers most questions of this

kind.
Try it!

Regards,
Stefi

"shiro" ezt Ć*rta:

On auto filter,usually there is a criteria '(All)'.What
is the match word in the vba to represent '(All)' to
show all records?

here is my filter
SourceRange.AutoFilter Field:=7, _
Criteria1:="=" & WS.Range("A10").Value

I tried to add word (All) but it returns no record.
Thnk's

Rgds,

Shiro







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
Filter with criteria! ernietan Excel Discussion (Misc queries) 1 April 15th 10 09:40 AM
Filter criteria Tony Excel Discussion (Misc queries) 2 November 24th 05 10:40 AM
Filter Criteria Yaasien Excel Discussion (Misc queries) 3 May 26th 05 02:43 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
Filter Criteria desmondleow[_7_] Excel Programming 1 December 16th 03 01:10 PM


All times are GMT +1. The time now is 07:40 AM.

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"