View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OJ[_2_] OJ[_2_] is offline
external usenet poster
 
Posts: 111
Default Check for Existance of sheet - problem with UDF

Hi,
the error occurs when you try to examine a property of a sheet that
doesn't exist. Try this instead...

PC Apr 8, 1:30 am show options

Newsgroups: microsoft.public.excel.programming
From: "PC" <paulm dot c @ iol dot ie - Find messages by this author
Date: Fri, 8 Apr 2005 09:30:06 +0100
Local: Fri, Apr 8 2005 1:30 am
Subject: Check for Existance of sheet - problem with UDF
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

Hi,


I'm using a udf to test for the existance of a worksheet and to perform
an
action if the sheet is found. The code for the function is as follows:


Function WksExists(ByVal wksName As String) As Boolean
On Error Resume Next
Let wksName = Worksheets(wksName).*Name
If Err = 0 Then WksExists = True
End Function

Hth,
OJ