PC Review


Reply
Thread Tools Rate Thread

Can a Macro utilize an auto filter?

 
 
=?Utf-8?B?U3VzYW4=?=
Guest
Posts: n/a
 
      5th Oct 2006
I have column in my spreadsheet and it already has an autofilter associted
with it. I use the custom auto filter function to do a "contains" search for
a particualar string I am looking for. I was wondering if I could create a
macro that is associated to a button that does the same thing? I want an
un-experienced user to be able to type the string they are looking for into a
text box, click the button, and all the fields in that column that contain
the string will appear. Is this possible?
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      5th Oct 2006
It seems that you could just tell them to select from the filter arrow.
However, to do what you want, try recording a macro and then using " &
range("a1") & " instead of the recorded reference.

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Susan" <(E-Mail Removed)> wrote in message
news:7A52C0C7-5019-4077-A5D8-(E-Mail Removed)...
>I have column in my spreadsheet and it already has an autofilter associted
> with it. I use the custom auto filter function to do a "contains" search
> for
> a particualar string I am looking for. I was wondering if I could create
> a
> macro that is associated to a button that does the same thing? I want an
> un-experienced user to be able to type the string they are looking for
> into a
> text box, click the button, and all the fields in that column that contain
> the string will appear. Is this possible?



 
Reply With Quote
 
=?Utf-8?B?U3VzYW4=?=
Guest
Posts: n/a
 
      5th Oct 2006
We're worried that the filter arrow may be too many steps for a user that is
not very used to excel. In your suggestion, when recording the macro, would
I record while I did a search in the autofilter? And when I selected
"contains," what would I put in the box for what I'm searching for, the "&
range ("a1")&" reference?

"Don Guillett" wrote:

> It seems that you could just tell them to select from the filter arrow.
> However, to do what you want, try recording a macro and then using " &
> range("a1") & " instead of the recorded reference.
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Susan" <(E-Mail Removed)> wrote in message
> news:7A52C0C7-5019-4077-A5D8-(E-Mail Removed)...
> >I have column in my spreadsheet and it already has an autofilter associted
> > with it. I use the custom auto filter function to do a "contains" search
> > for
> > a particualar string I am looking for. I was wondering if I could create
> > a
> > macro that is associated to a button that does the same thing? I want an
> > un-experienced user to be able to type the string they are looking for
> > into a
> > text box, click the button, and all the fields in that column that contain
> > the string will appear. Is this possible?

>
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      5th Oct 2006
Sub Filterbasedoncell()' from a UNfiltered range
Range("A1").AutoFilter Field:=1, Criteria1:=Range("c1") '"3"
End Sub
Sub Unfilter()
Selection.AutoFilter
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Susan" <(E-Mail Removed)> wrote in message
news:BE615BB5-EA91-4497-BB07-(E-Mail Removed)...
> We're worried that the filter arrow may be too many steps for a user that
> is
> not very used to excel. In your suggestion, when recording the macro,
> would
> I record while I did a search in the autofilter? And when I selected
> "contains," what would I put in the box for what I'm searching for, the "&
> range ("a1")&" reference?
>
> "Don Guillett" wrote:
>
>> It seems that you could just tell them to select from the filter arrow.
>> However, to do what you want, try recording a macro and then using " &
>> range("a1") & " instead of the recorded reference.
>>
>> --
>> Don Guillett
>> SalesAid Software
>> (E-Mail Removed)
>> "Susan" <(E-Mail Removed)> wrote in message
>> news:7A52C0C7-5019-4077-A5D8-(E-Mail Removed)...
>> >I have column in my spreadsheet and it already has an autofilter
>> >associted
>> > with it. I use the custom auto filter function to do a "contains"
>> > search
>> > for
>> > a particualar string I am looking for. I was wondering if I could
>> > create
>> > a
>> > macro that is associated to a button that does the same thing? I want
>> > an
>> > un-experienced user to be able to type the string they are looking for
>> > into a
>> > text box, click the button, and all the fields in that column that
>> > contain
>> > the string will appear. Is this possible?

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?U3VzYW4=?=
Guest
Posts: n/a
 
      9th Oct 2006
Thanks so much for all of the extremly useful information. I have one last
question, is there a way to change the code so that it utilizes the
"contains" function in autofilter as opposed to just the criteria? If there
are multiple strings in a cell that are seperated by commas, I would like it
to still return that cell if any one of the strings is the entered criteria.
Thanks in advance for all your help.


"Don Guillett" wrote:

> Sub Filterbasedoncell()' from a UNfiltered range
> Range("A1").AutoFilter Field:=1, Criteria1:=Range("c1") '"3"
> End Sub
> Sub Unfilter()
> Selection.AutoFilter
> End Sub
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Susan" <(E-Mail Removed)> wrote in message
> news:BE615BB5-EA91-4497-BB07-(E-Mail Removed)...
> > We're worried that the filter arrow may be too many steps for a user that
> > is
> > not very used to excel. In your suggestion, when recording the macro,
> > would
> > I record while I did a search in the autofilter? And when I selected
> > "contains," what would I put in the box for what I'm searching for, the "&
> > range ("a1")&" reference?
> >
> > "Don Guillett" wrote:
> >
> >> It seems that you could just tell them to select from the filter arrow.
> >> However, to do what you want, try recording a macro and then using " &
> >> range("a1") & " instead of the recorded reference.
> >>
> >> --
> >> Don Guillett
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "Susan" <(E-Mail Removed)> wrote in message
> >> news:7A52C0C7-5019-4077-A5D8-(E-Mail Removed)...
> >> >I have column in my spreadsheet and it already has an autofilter
> >> >associted
> >> > with it. I use the custom auto filter function to do a "contains"
> >> > search
> >> > for
> >> > a particualar string I am looking for. I was wondering if I could
> >> > create
> >> > a
> >> > macro that is associated to a button that does the same thing? I want
> >> > an
> >> > un-experienced user to be able to type the string they are looking for
> >> > into a
> >> > text box, click the button, and all the fields in that column that
> >> > contain
> >> > the string will appear. Is this possible?
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-Filter within a Macro =?Utf-8?B?amVhbm5pZSB2?= Microsoft Excel Misc 1 17th Jun 2007 10:59 AM
auto filter macro =?Utf-8?B?TGFycnk=?= Microsoft Excel Programming 2 7th Apr 2007 02:38 AM
Auto Filter Macro =?Utf-8?B?U25ha2VvaWRz?= Microsoft Excel Misc 6 24th Aug 2005 08:46 PM
auto filter macro Microsoft Excel Worksheet Functions 4 23rd Nov 2003 09:16 PM
auto filter macro Microsoft Excel Misc 0 23rd Nov 2003 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:04 PM.