Hi all,
Using Excel 2013 64-bit.
I recrded a bit of code while clearing a filter.
The resulting code gave me the ShowAllData Method
So I tried using in my procedure but I am receiving an error:
Run-time error '1004':
ShowAllData Method of Worksheet Class Failed
Any idea what I am doing wrong?
Thanks
w
avSheets = Array("Control", "Work", "Work2")
'Make sure autofilter is off
'Make sure all rows are visible
'Clear previous data from sheets that hold temporary data
For l = 1 To UBound(avSheets)
With wb
Set ws = .Worksheets(avSheets(l))
With ws
.Activate
With ActiveSheet
.ShowAllData
End With
.AutoFilterMode = False
.Select
With Selection
.EntireRow.Hidden = False
End With
.UsedRange.ClearContents
End With
End With
Next l
Bookmarks