• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Filter

Dan Kennedy

New Member
Hello,

I am hoping somebody can help me with some VBA code. I posted this question about a week ago on another board but have not gotten a lot of suggestions. In the attached workbook I have a filter set up on the first page in column I5. I would like to set this up so that it looks at a column on each page - for example the T4 Tower page and filters that column based on the selection made on the first page in I5. I am not a VBA wizard but this is what I started with. In the full worksheet there are 8 or more separate pages to filter, but I am thinking I may be able to just filter the data on the T4 Tower page and get what I need. Also it may be easier if all the filtering criteria for example, in column CR on the T4 Tower page, were all in the same column. I have a workbook I could send to somebody but I can't get it small enough to post here. If somebody can help and private message me then I could email it to you.
upload_2016-10-18_8-8-49.png

If anybody has a way to do this I would really appreciate the help.
Thank you,

Dan
 
Do You only 'add new filter' or
when do You 'clear old filter'?
If only make/add new filtering then soon that not work anymore...
 
The filtering is based on the selection by the user. It really depends on the runmode of the equipment they are interested in. It would be really nice if I could set it to default back to All when the workbook is closed.
 
As I wrote ...
when do You 'clear old filter'?
If only make/add new filtering then soon that not work anymore...

You have sent few lines from something code ... is it enough?
Could You make a Sample File (with 50-100 row, whatever)
and wanted results?
? is a question mark ... maybe next time some answers too?
> Ideas? ... Questions? ... Answers?
 
I guess I don't understand your question of clearing the old filter. I was expecting the filter to clear when ALL was selected from the list. That would then show all values again. The code I have shown is all I have, I don't think that is enough.

I have the sample file attached. Currently the list box on the index page is set to ALL, when any other choice is selected I want it to go to the T4 Tower page look at column CR and filter based on the selection made on the Index page. I would replicate this filter to the real workbook that has 9 total pages similar to the T4 Tower page.

Hopefully the file will help.
 

Attachments

This works great and does exactly what I wanted it to do. For some reason when I put it in my original workbook nothing happens. It looks like you referenced the autofilter at 94. Would I have to have that column in the same place on all the pages for it to work correctly. Sorry for all the questions.

Thank you,

Dan
 
That works only with Your sample file's layout without modifications.
Columns and even rows of headers have to be same.
Ex. if You 'delete' 1st row of data-sheet or add one column to left then no work!
but ... after needed modifications, it should work.
Ideas? ... Questions?
 
Back
Top