Advanced Filter Error

  • Thread starter Thread starter Wayne Burritt
  • Start date Start date
W

Wayne Burritt

Hi: I programmed a little macro (see below) to clear the advanced filter
function after a search is made. It works fine. The problem is if the
search didn't get any hits and you clear it, I get the following:

"Runtime error 1004: ShowAllData method of Worksheet class failed"

You just press "end" and it's ok but the people running the spreadsheet get
worried. Is there a way to display a message like "There was no data to
clear"; or just get rid of that error message?

Thanks, Wayne





Sub Adv_Filter_Clear()
'
' Adv_Filter_Clear Macro
' Macro recorded 8/9/2003 by Wayne
'

'
Range("B8").Select
ActiveSheet.ShowAllData
Range("B8").Select
End Sub
 
Back
Top