Hi,
I have a spreadsheet where I added several macro buttons that the end users can use to filter data across various columns. I also added a macro button to unfilter the spreadsheet since there are so many columns. My question is, is there a way to add a pop-up message to the code so if the spreadsheet does not have any filters on (all columns and rows not hidden? Right now, if there are no filters and the control button is selected, you get a run-time error 1004. I'd like to have a pop-up saying the spreadsheet is not currently filtered, or words to the like. Below is my code so far:
Thank you,
Kat
I have a spreadsheet where I added several macro buttons that the end users can use to filter data across various columns. I also added a macro button to unfilter the spreadsheet since there are so many columns. My question is, is there a way to add a pop-up message to the code so if the spreadsheet does not have any filters on (all columns and rows not hidden? Right now, if there are no filters and the control button is selected, you get a run-time error 1004. I'd like to have a pop-up saying the spreadsheet is not currently filtered, or words to the like. Below is my code so far:
VBA Code:
Sub ClearFilters_Click() ' clear filters
ActiveSheet.Unprotect Password:="1234"
Sheets("CMLog").Rows("10:10000").EntireRow.Hidden = False
Sheets("CMLog").Columns("B:AC").EntireColumn.Hidden = False
Sheets("CMLog").ShowAllData
Range("E4") = ("ALL")
Range("H4") = ("ALL")
Range("L4") = ("ALL")
ActiveSheet.Protect Password:="1234"
End Sub
Thank you,
Kat