Testing to see if a sheet name exists
I have a procedure that adds a sheet and then names the sheet from a
list. Then it will add another sheet and name the next sheet from the
next name in the list.
My problem is that, on occassion, a name will be duplicated. I need
the information associated with the both the duplicated names but you
can't name 2 sheets with the same name.
I don't know how to test for the existence of the name in the
workbook. If I did - I could use an if statement to say that if there
is a sheet with the same name then add a 1 or a space to distinguish
the second sheet.
I've tried on error goto line1: - but this doesn't seem to work.
Can anybody help me?
Thanks much in advance
|