View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Finding if Excel Sheet exists

Pedro

You could iterate over the sheets collection

Sub IterateSheets()
Dim sht As Object
For Each sht In ActiveWorkbook.Sheets
If sht.Name = "Your Sheet Name" Then
MsgBox "Sheet found"
sht.Activate
Exit Sub
End If
Next sht
MsgBox "Sheet not found"
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Pedro Miguel C. Silva" wrote in message
...
Hi! Can anyone tell me how to find if an Excel Sheet is already created?
Is there an instruction in VBA to make this?
For example, to look for a value in a table we have HLookup, VLookup and
Lookup. Is there an instruction for Sheets?

Thanks.

Pedro