Quick Question

  • Thread starter Thread starter sosteffo
  • Start date Start date
S

sosteffo

Selection.AutoFilter Field:=2, Criteria1:="=BO", Operator:=xlAnd


How would i replace the "BO" with a cell reference. i.e A
 
Hi
This is from one of my VB programs, feel free to
plagaurize (sp) to your heart's content. HTH

Name the cell a1 "Lookup"

Note, that by changing the criteria the way I have
indicated will allow the user to input a partial name, and
you will be able to get a match on anything that hits
close.


Dim userlookup As String
userlookup = Range("Lookup").Text

'
Application.ScreenUpdating = False
Range("chartstart").Select
Selection.AutoFilter Field:=2, Criteria1:="=*" &
(userlookup) & "*", Operator:=xlAnd
Application.ScreenUpdating = True
Range("Lookup").Select
 
Hi
try
Selection.AutoFilter Field:=2, Criteria1:=Range("X1").value,
Operator:=xlAnd
 

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