Hello,
I have a macro that shows all the data hidden by an autofilter. This macro works fine when there is at least one item that has been filter. Whenever I try to run this macro without an item being filtered, I get an error. Is there a way to set up an IF statement to say if there is a filter present, run the macro; else ignore the macro? I've attached the macro below.
Thanks!
Sheets("Summary").Select
ActiveSheet.Unprotect
'
ActiveSheet.ShowAllData
Range("A3").Select
Sheets("Summary").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFiltering:=True
I have a macro that shows all the data hidden by an autofilter. This macro works fine when there is at least one item that has been filter. Whenever I try to run this macro without an item being filtered, I get an error. Is there a way to set up an IF statement to say if there is a filter present, run the macro; else ignore the macro? I've attached the macro below.
Thanks!
Sheets("Summary").Select
ActiveSheet.Unprotect
'
ActiveSheet.ShowAllData
Range("A3").Select
Sheets("Summary").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFiltering:=True