Could you not do something like
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples:
http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
"bevchapman" wrote:
I am building a Macro that can run on a worksheet training matrix whether if
is filtered or not. It works beautifully as long as the file is filtered but
need to work both ways.
Here is the text I have for my macro so far
Sheets("Tech Plan").Select
ActiveSheet.Unprotect ("MPT8883900")
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$10:$BO$569").AutoFilter Field:=53
ActiveSheet.Range("$A$10:$BO$569").AutoFilter Field:=53, Criteria1:="X"
ActiveSheet.Protect ("MPT8883900")
I am trying to bypass the ShowAllData line if it has already been
unfiltered. I have about 60 files to run this on and would appreciate any
help.