#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Automatic Filtering

Hi there,

Is there a way to create a filter that accomplishes the following:

Example Speradsheet
A B
1
2 City State
3 Phoenix AZ
4 Los Angeles CA
5 San Francisco CA

I would like to filter the above data by the state of CA just by typing "CA"
into cell B1 and hitting enter.

I tried playing with advanced filtering, but every time I wish to filter on
a different state, I must go to Data, Filter, Advanced Filter. I could make
a macro to do this part, but was wondering if there is a different kind of
filter I could use.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 623
Default Automatic Filtering

Yes, a macro could do the job, but it sounds overly complicated to me. Why not
just use AutoFilter? (not Advanced, just the normal one). It will give you a
drop down arrow in your State cell, you click on it and select CA. It's at least
as easy, if not easier, than typing CA in another cell.

If you're having trouble turning it on, it may be because row 1 is blank. Either
delete row 1, or highlight row 2 when you turn it on.

--
Regards,
Fred


"sjamadok" wrote in message
...
Hi there,

Is there a way to create a filter that accomplishes the following:

Example Speradsheet
A B
1
2 City State
3 Phoenix AZ
4 Los Angeles CA
5 San Francisco CA

I would like to filter the above data by the state of CA just by typing "CA"
into cell B1 and hitting enter.

I tried playing with advanced filtering, but every time I wish to filter on
a different state, I must go to Data, Filter, Advanced Filter. I could make
a macro to do this part, but was wondering if there is a different kind of
filter I could use.




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Automatic Filtering

Thanks for your thoughts Fred.
I use auto filters a lot, but I'm trying to figure out a quicker way. For
example, if I want to filter on, say WV, I have to scroll all the way to the
bottom of the auto filter. I could also choose "Custom..." in the auto
filter and use 'is equal to'. However, it would be much more efficient if I
could just type the state into a cell and have the spreadsheet filter based
on that cell.
--sjamadok

"Fred Smith" wrote:

Yes, a macro could do the job, but it sounds overly complicated to me. Why not
just use AutoFilter? (not Advanced, just the normal one). It will give you a
drop down arrow in your State cell, you click on it and select CA. It's at least
as easy, if not easier, than typing CA in another cell.

If you're having trouble turning it on, it may be because row 1 is blank. Either
delete row 1, or highlight row 2 when you turn it on.

--
Regards,
Fred


"sjamadok" wrote in message
...
Hi there,

Is there a way to create a filter that accomplishes the following:

Example Speradsheet
A B
1
2 City State
3 Phoenix AZ
4 Los Angeles CA
5 San Francisco CA

I would like to filter the above data by the state of CA just by typing "CA"
into cell B1 and hitting enter.

I tried playing with advanced filtering, but every time I wish to filter on
a different state, I must go to Data, Filter, Advanced Filter. I could make
a macro to do this part, but was wondering if there is a different kind of
filter I could use.





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Automatic Filtering

That works wonderfully. Thanks Fred!

"Fred Smith" wrote:

The macro you want is a simple one-liner:

Sub SelectState()
Selection.AutoFilter Field:=2, Criteria1:=Range("B1")
End Sub

When you create the macro, you can assign it to a control key, like a. You would
then enter WV in B1, and hit Ctrl-a.

Let me know how it works.

--
Regards,
Fred


"sjamadok" wrote in message
...
Thanks for your thoughts Fred.
I use auto filters a lot, but I'm trying to figure out a quicker way. For
example, if I want to filter on, say WV, I have to scroll all the way to the
bottom of the auto filter. I could also choose "Custom..." in the auto
filter and use 'is equal to'. However, it would be much more efficient if I
could just type the state into a cell and have the spreadsheet filter based
on that cell.
--sjamadok

"Fred Smith" wrote:

Yes, a macro could do the job, but it sounds overly complicated to me. Why
not
just use AutoFilter? (not Advanced, just the normal one). It will give you a
drop down arrow in your State cell, you click on it and select CA. It's at
least
as easy, if not easier, than typing CA in another cell.

If you're having trouble turning it on, it may be because row 1 is blank.
Either
delete row 1, or highlight row 2 when you turn it on.

--
Regards,
Fred


"sjamadok" wrote in message
...
Hi there,

Is there a way to create a filter that accomplishes the following:

Example Speradsheet
A B
1
2 City State
3 Phoenix AZ
4 Los Angeles CA
5 San Francisco CA

I would like to filter the above data by the state of CA just by typing
"CA"
into cell B1 and hitting enter.

I tried playing with advanced filtering, but every time I wish to filter on
a different state, I must go to Data, Filter, Advanced Filter. I could
make
a macro to do this part, but was wondering if there is a different kind of
filter I could use.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Filtering Mike Excel Worksheet Functions 0 July 26th 06 10:41 PM
Automatic filtering and coping result to a seperate sheet Richard P Excel Worksheet Functions 2 April 23rd 06 07:28 PM
Please help with adding automatic data. tnnt Excel Discussion (Misc queries) 1 March 8th 06 09:42 AM
Advance filtering with multiple conditons falloutx Excel Discussion (Misc queries) 3 January 21st 06 07:28 PM
options to update automatic links Werner Rohrmoser Excel Worksheet Functions 0 November 10th 05 12:58 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"