Filtering in Excel

K

Kerry

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
 
M

Marcelo

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:
 
K

Kerry

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top