sheet name used ?

  • Thread starter Thread starter Corey
  • Start date Start date
C

Corey

I have a code to create a copy of a sheet, and re-name it.
I have put a :
if res="" then
exit sub

but if res= 'An existing sheet name already' How do i write this?

if res=sheets.name ?

???


Regards

Corey
 
On Error Resume Next
Set sh = Worksheets("sheetname")
On Error Goto 0
If sh Is Nothing Then
'do your stuff
End If

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top