View Single Post
  #2   Report Post  
StinkeyPete
 
Posts: n/a
Default

Try this:

Sub Macro4()
On Error Resume Next
ActiveSheet.ShowAllData
End Sub


"Snakeoids" wrote:

Greetings,
I have created a button on a worksheet with the following code:
Sub Macro4()
ActiveSheet.ShowAllData
End Sub

When I have the Autofilter active for a column(s), I just press this button
and the filter is taken off. No problems. However if I press the button
when the Autofilter is not filtering any of the columns, I get a debug error.
How do I tell the computer that if I press the button while the Autofilter
is already off, don't do anything? Thanks.