Computing.Net > Forums > Programming > VBA autofilter based on cell value

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBA autofilter based on cell value

Reply to Message Icon

Name: 50pingviner
Date: April 28, 2009 at 01:30:34 Pacific
OS: Windows XP
Subcategory: General
Comment:

Hi,

I would like to autofilter based on a cell value using the filter "contains" as filter.

In other words if I for instance want to search for all rows in an autofilter containing the word "VBA" (as an example"), where the value "VBA" has been written in a cell. How would I do that?

I know that the code for "contains" would be

Criteria1:="=*VBA*", Operator:=xlAnd

and that the code for taken the value from a cell woud be:

Criteria1:=Range("A1").Text

So basically I need to combine the two above and are having difficulties doing it.

Can anyone help?

Thx. in advance

Lars



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VBA autofilter based on cell value

Replace text base on 2 value www.computing.net/answers/programming/replace-text-base-on-2-value/16819.html

Auto delete based on date www.computing.net/answers/programming/auto-delete-based-on-date/837.html

Change value in char array in C www.computing.net/answers/programming/change-value-in-char-array-in-c/10213.html