ActiveSheet.ShowAllData

P

Paul

Hi

Whats the best way to code to ensure that filters aren't
enabled when a macro is running

ActiveSheet.ShowAllData

above works fine if filters are enabled but returns an
error in the code if filters arent enabled

thanks in advance
Paul
 
D

Dave Peterson

with activesheet
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
end if
end with

another way is to just ignore the error:

on error resume next
activesheet.showalldata
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top