ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sheet name used ? (https://www.excelbanter.com/excel-programming/376598-sheet-name-used.html)

Corey

sheet name used ?
 
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



Bob Phillips

sheet name used ?
 
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)

"Corey" wrote in message
...
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






All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com