-
Sep 25th, 2014, 11:26 AM
#1
Thread Starter
Lively Member
[RESOLVED] Excel VBA: Table, Field Search "Text Filters--> Contains"
I need a macro that will search the first column of my table for a specific entry. I have seen code that I've tried to use, but because my database is arranged as a table I suspect that that is the reason it isn't working.
Example: my repetitive action is that I have to click on the column sort button every time I need to find something and then I have to manually select "Text Filters" and then "Contains" and then type what I'm looking for.
I need a button which will allow me to just type in what I'm looking for instead of having to do this action manually 50-60 times a day.
Below is an example of what did not work, but is similar to what I'm looking for.
Code:
ActiveSheet.Range("$A$1:$A$152184").AutoFilter Field:=1, Criteria1:= _
"=*" & Range("J3").Value & "*", Operator:=xlAnd
-
Sep 25th, 2014, 11:29 AM
#2
Thread Starter
Lively Member
Re: Excel VBA: Table, Field Search "Text Filters--> Contains"
is there an easy way to reference the table (Named: Contra) so as to cut down on compiling, and to ID a specific column for searching the inputted text?
-
Sep 25th, 2014, 12:53 PM
#3
Re: Excel VBA: Table, Field Search "Text Filters--> Contains"
can you attach an example of the before and after?
-
Sep 25th, 2014, 02:14 PM
#4
Thread Starter
Lively Member
Re: Excel VBA: Table, Field Search "Text Filters--> Contains"
vbfbryce... I nailed it down myself (super proud of that lol)... took some extra thinking it through but I'm getting better. I'll post the solution and some screenshots of how it works when I get back to my computer.
-
Sep 25th, 2014, 02:21 PM
#5
Re: Excel VBA: Table, Field Search "Text Filters--> Contains"
Sounds good, and congrats!
-
Sep 26th, 2014, 03:57 PM
#6
Thread Starter
Lively Member
Re: Excel VBA: Table, Field Search "Text Filters--> Contains"
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|