How do I check whether a sheet (by a certain name) already exists in the
current
workbook ??
Example:
I have a workbook with sheets called r1, r2,r3, etc. I want to find out
if r12 exists and if not create it (the latter proposes no problem however).
TIA
Sammy
Try this function:
Function SheetExists(ShName As String) As Boolean
On Error Resume Next
SheetExists = Len(ActiveWorkbook.Sheets(ShName).Name)
End Function
Sub test()
MsgBox SheetExists("Sheet1")
MsgBox SheetExists("r1")
End Sub
Best wishes Harald
Sammy <Sa...@somewhere.nl> wrote in message
news:TLST15...@telestars.nl...
Harald,
you're the man :)
thanks, works like a charm !
Sammy