Hi guys I have seen this question asked before but not exactly like this.
I have multiple sheets and some of them need auto filter to stay in place.
My problem, just for example, I have sheet 1 that when I pick a certain drop down, information automatically goes into sheet 2
And when I change sheet 3, information automatically goes to sheet 4. At times I will use auto filter just to get a summary for a certain month for example, and if I forget to turn it off the next time I trigger a movement from sheet 1 to 2 or 3 to 4 it doesn’t go in to the next available line, it just goes randomly in the sorted list and overtypes a previous entry.
In English I’d like a code that says “on close if sheet 2 is visible remove auto filter and if sheet 4 is visible remove autofilter etc”
The reason for the visible is not all users have access to all sheets so if I do “sheet 2. select. clear all filters, I’ll get an error I’d guess.
Also if it’s possible where would I put the code. I currently have a private sub for workbook_beforeclose (cancel as Boolean) in “This workbook” module so my guess would Be in there
I have multiple sheets and some of them need auto filter to stay in place.
My problem, just for example, I have sheet 1 that when I pick a certain drop down, information automatically goes into sheet 2
And when I change sheet 3, information automatically goes to sheet 4. At times I will use auto filter just to get a summary for a certain month for example, and if I forget to turn it off the next time I trigger a movement from sheet 1 to 2 or 3 to 4 it doesn’t go in to the next available line, it just goes randomly in the sorted list and overtypes a previous entry.
In English I’d like a code that says “on close if sheet 2 is visible remove auto filter and if sheet 4 is visible remove autofilter etc”
The reason for the visible is not all users have access to all sheets so if I do “sheet 2. select. clear all filters, I’ll get an error I’d guess.
Also if it’s possible where would I put the code. I currently have a private sub for workbook_beforeclose (cancel as Boolean) in “This workbook” module so my guess would Be in there
Last edited: