LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Is Nothing

Hi there,

I'm always getting into trouble with the Is Nothing statement. At the
moment, I want to delete a specific sheet if it exists prior to adding
another of the same name, so:

If Not wkb.Sheets("TempSheet") Is Nothing Then
wkb.Sheets("TempSheet").Delete
End If

I'm getting a subscript out of range error on the first line (above) and a
err code of 9 (PS can anyone point me to a list of error codes?)

Can anyone tell me what I'm doing wrong?

Thanks

John


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"