View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Norvascom Norvascom is offline
external usenet poster
 
Posts: 21
Default macro to continue running if error

Hi,

I have the following macro that is working fine. It is looking at a
specified worksheet array and executing the macro "Filter" on each
worksheets. However, in case one of the worksheet is not existing, I
would like the macro to pass the non existing worksheet and continue
running on the next available worksheet. I tried adding the following
statement: "On Error Resume Next" at the beginning but it is passing
everything.

Any help would be appreciated.
Thanks

Sub UpdateAll()
For Each sh In Worksheets(Array("1", "2", "3", "4", "5", "6", "7",
"10", "11", "12", "21", "22", _
"23", "24", "25", "26", "27", "28", "29", "30", "31", "41", "42",
"43", "44", "45", "46", _
"47", "48", "49", "50", "51", "52", "53", "54", "55", "61"))
sh.Select
Call Filter
Next sh
End Sub