ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Filtering in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/169368-filtering-excel.html)

Kerry

Filtering in Excel
 
I have created a database in Excel 2003 of organisations that provide
services. I have the list of organisations on sheet 2 with column headings of
name, address, phone number and ten other columns that have the name of a
service type ie respite, accommodation etc. On sheet 1 I have created
corresponding buttons that have macros attached. When you click on a button
it goes to sheet 2 and using the columns with the service types filters out
the organisations that don't provide that service. At the bottom of each
column there is another button that unfilters and takes the user back to
sheet 1. If the user doesn't use the back button but clicks on the sheet 1
tab it doesn't unfilter and this creates a problem for the next user. Is
there a way to automatically unfilter when you click on the sheet 1 tab.

Thanks, Kerry

Marcelo

Filtering in Excel
 
Hi Kerry,

why not execute the unfilter macro before the filter in each button command?

excle will unfilter before filter.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Kerry" escreveu:

I have created a database in Excel 2003 of organisations that provide
services. I have the list of organisations on sheet 2 with column headings of
name, address, phone number and ten other columns that have the name of a
service type ie respite, accommodation etc. On sheet 1 I have created
corresponding buttons that have macros attached. When you click on a button
it goes to sheet 2 and using the columns with the service types filters out
the organisations that don't provide that service. At the bottom of each
column there is another button that unfilters and takes the user back to
sheet 1. If the user doesn't use the back button but clicks on the sheet 1
tab it doesn't unfilter and this creates a problem for the next user. Is
there a way to automatically unfilter when you click on the sheet 1 tab.

Thanks, Kerry


Kerry

Filtering in Excel
 
Hi Marcelo,

That sounds like a great idea but if there are ten columns how would the
unfilter macro know which column to unfilter? Is there a way to create a
general unfilter macro I could use for all columns.

thanks, Kerry

"Marcelo" wrote:

Hi Kerry,

why not execute the unfilter macro before the filter in each button command?

excle will unfilter before filter.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Kerry" escreveu:

I have created a database in Excel 2003 of organisations that provide
services. I have the list of organisations on sheet 2 with column headings of
name, address, phone number and ten other columns that have the name of a
service type ie respite, accommodation etc. On sheet 1 I have created
corresponding buttons that have macros attached. When you click on a button
it goes to sheet 2 and using the columns with the service types filters out
the organisations that don't provide that service. At the bottom of each
column there is another button that unfilters and takes the user back to
sheet 1. If the user doesn't use the back button but clicks on the sheet 1
tab it doesn't unfilter and this creates a problem for the next user. Is
there a way to automatically unfilter when you click on the sheet 1 tab.

Thanks, Kerry


Bob Phillips

Filtering in Excel
 
Add this code to sheet1

Private Sub Worksheet_Activate()
'insert your unfilter code in here
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Kerry" wrote in message
...
Hi Marcelo,

That sounds like a great idea but if there are ten columns how would the
unfilter macro know which column to unfilter? Is there a way to create a
general unfilter macro I could use for all columns.

thanks, Kerry

"Marcelo" wrote:

Hi Kerry,

why not execute the unfilter macro before the filter in each button
command?

excle will unfilter before filter.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Kerry" escreveu:

I have created a database in Excel 2003 of organisations that provide
services. I have the list of organisations on sheet 2 with column
headings of
name, address, phone number and ten other columns that have the name of
a
service type ie respite, accommodation etc. On sheet 1 I have created
corresponding buttons that have macros attached. When you click on a
button
it goes to sheet 2 and using the columns with the service types filters
out
the organisations that don't provide that service. At the bottom of
each
column there is another button that unfilters and takes the user back
to
sheet 1. If the user doesn't use the back button but clicks on the
sheet 1
tab it doesn't unfilter and this creates a problem for the next user.
Is
there a way to automatically unfilter when you click on the sheet 1
tab.

Thanks, Kerry





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com