Pretty new on VBA. Seems to be differnt syntax for declaring variables on Private function compared with Public.
I have this macro which clears and switches off a specific filter in a specific sheet but because I want to to run on File/Exit I need to make it a Private function in This Workbook, but the syntax fail. Ideally I would like to clear and switch off all filtering in all worksheets.
I'm sure it is very simple so if yu could supply the code it would be great and also perhaps link to the best explaination for the line one syntax for the Private function.
Many thanks
![]()
Sub ClearXDataFilterOnExit() ' ' ClearXDataFilterOnExit Macro ' ' ActiveSheet.ShowAllData Selection.AutoFilter End Sub
Bookmarks