Thread
:
How can I check to see if a sheet exists?
View Single Post
#
4
Posted to microsoft.public.excel.programming
Lars-Åke Aspelin[_2_]
external usenet poster
Posts: 913
How can I check to see if a sheet exists?
On Sun, 14 Dec 2008 11:29:01 -0800, Cruzian_Rain Girl <Cruzian_Rain
wrote:
Hello.
I have to be able to write a code in Visual Basic that can check to see if a
sheet exists and post a msgbox saying 'true' or 'false', depending on the
answer.
Example- Check to see if 'Bob' exists.
if it does then Msgbox 'true'
Can anyone help me please?
Here is another way you may try;
Sub sheet_check()
On Error GoTo sheet_missing
MsgBox Worksheets("Bob").Name = "Bob"
Exit Sub
sheet_missing: MsgBox "false"
End Sub
Hope this helps / Lars-Åke
Reply With Quote
Lars-Åke Aspelin[_2_]
View Public Profile
Find all posts by Lars-Åke Aspelin[_2_]