I am using this code:
Sheets(\"Sheet1\").AutofilterMode = False
to unfilter the data in an Excel sheet using VBA (the point is to clear al
The ShowAllData
will work only if your sheet has a filter, otherwise it will break. I found that you can create a function from this with On Error Resume Next
and it should work in all cases:
Sub ShowAllData()
On Error Resume Next
Worksheets("Sheet1").ShowAllData
End Sub
Then call function from your main sub:
Sub Main()
ShowAllData
End Sub
Use Worksheets("Sheet1").ShowAllData
instead. See http://msdn.microsoft.com/en-us/library/office/bb178108%28v=office.12%29.aspx.