using Criteria with two possible values

  • Thread starter Thread starter DKY
  • Start date Start date
D

DKY

I have something that looks like so in a macro code.
Criteria1:="not in system"
how do I make it for more than one thing? I want the criteria to b
"not in system" or "NOT OKC". I dont even know how to word this to ge
my answer with microsoft help. Any guidance would be appreciated.
Thanks in advance
 
Hi DKY

it would probably be better if you posted a bit more of your code, is this
for filtering of excel lists?
if so then

Selection.AutoFilter Field:=1, Criteria1:="=not in system",
Operator:=xlOr, _
Criteria2:="=NOT OKC"

if it's for something else, please post back

Regards
JulieD
 
DKY,

Criteria1:="=not in system", _
Operator:=xlOr, _
Criteria2:="=NOT OKC"

You could get that code by recording a macro and applying the autofilter.

HTH,
Bernie
MS Excel MVP
 
Your query is not very clear.

Criteria:="not in system" suggests that you are calling a routine which
expects an argument called Criteria.

If I understand the rest of the query, you want to control the flow of the
code depending on the value of Criteria. Try


Sub xx(ByVal Criteria as string)
 
The reply was incomplete ....

Your query is not very clear.

Criteria:="not in system" suggests that you are calling a routine which
expects an argument called Criteria.

If I understand the rest of the query, you want to control the flow of the
code depending on the value of Criteria. Try


Sub xx(ByVal Criteria as string)

select case criteria
case "not in system"
' your code
case "NOT OKC"
' your code code
case else
' your code
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top