View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] dean.brunne@lion-nathan.com.au is offline
external usenet poster
 
Posts: 15
Default If worksheet from array exists then not working

Hi-I have an array that before it loops throught the code to create
worksheets i need to determine if the worksheet name already exists.
If it does I want a msgbox to appear then exit the sub. I created the
code below but it does not work. Error:Run time 438 Object doesn't
support this property or method.

If ThisWorkbook.Worksheets(MyArray(i, j)).Exists Then

MsgBox "Cost Centres already exist."
Exit Sub

Else

Please help. Thanks!