View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BeSmart BeSmart is offline
external usenet poster
 
Posts: 102
Default ShowAllData error

Hi All
(Excel 2003)

I'm using Advance filter on a week of data in
sheets("Week1").Range("A19:H148"), based on criteria in cells E17:E18 (E17 =
Blank, E18 = =E20<0).

At the end my macro I must "ShowAllData".

Sometimes there is no data to filter for a week and I get an error:
I still need to show the worksheet even though no weeks of data where found.

Error message:
"ShowAllData method of Worksheet class failed"

I tried including: Application.DisplayAlerts = False
but the error message still appears & stops the macro.

I also tried including the following - but still no joy

If ActiveSheet.FilterMode = True Then
ActiveSheet.ShowAllData
End If

Can anyone tell me what code I need to do two things:

- Don't show the error message or stop the macro when ShowAllData fails,
BUT
- type the text "NO NEW ACTIVITY" in cell D20 on the current worksheet
before continuing with the macro

--
Thank for your help
BeSmart