View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fred Smith Fred Smith is offline
external usenet poster
 
Posts: 623
Default On Error Goto ignored

I wanted to determine whether a sheet existed in the active workbook. So I
used:

On Error Goto NoPerfSheet
Sheets("Performance").Select
On Error Goto 0

However, Excel always stopped at the Sheets command, with a Subscript out of
range error.

I knew there would never be more than two sheets in the workbook, so I got
it working by using:

IF Sheets.Count = 1 Goto NoPerfSheet

However, I'm why the On Error statement was ignored.

What conditions causes VBE to ignore On Error?

--
Thanks,
Fred
Please reply to newsgroup, not e-mail