ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object Name (https://www.excelbanter.com/excel-programming/311203-object-name.html)

halem2[_31_]

Object Name
 

HI:

I'm trying to create a sub that would check for duplicate sheet ta
names and pop up a msg to the user.

Can anyone please tell me what the object name is for the Tab name???


thank

--
halem
-----------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993
View this thread: http://www.excelforum.com/showthread.php?threadid=26288


Bob Phillips[_6_]

Object Name
 
You can't have a duplicate, Excel won't allow it.

--

HTH

RP

"halem2" wrote in message
...

HI:

I'm trying to create a sub that would check for duplicate sheet tab
names and pop up a msg to the user.

Can anyone please tell me what the object name is for the Tab name???


thanks


--
halem2
------------------------------------------------------------------------
halem2's Profile:

http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=262888




Tom Ogilvy

Object Name
 
Excel doesn't allow duplicate sheet tab names. Are you trying to assess a
proposed name?

Activesheet.Name will give you the sheet tab name.

--
Regards,
Tom Ogilvy

"halem2" wrote in message
...

HI:

I'm trying to create a sub that would check for duplicate sheet tab
names and pop up a msg to the user.

Can anyone please tell me what the object name is for the Tab name???


thanks


--
halem2
------------------------------------------------------------------------
halem2's Profile:

http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=262888




Gary Brown[_7_]

Object Name
 
To check if a worksheet name exists, you can use...
'==============================================
Public Function SheetExists(sName) As Boolean
' Returns TRUE if sheet exists in the active workbook
Dim x As Object
On Error Resume Next
Set x = ActiveWorkbook.Sheets(sName)
If Err = 0 Then SheetExists = True _
Else SheetExists = False
End Function
'==============================================

HTH,
Gary Brown


-----Original Message-----

HI:

I'm trying to create a sub that would check for duplicate

sheet tab
names and pop up a msg to the user.

Can anyone please tell me what the object name is for the

Tab name???


thanks


--
halem2
----------------------------------------------------------

--------------
halem2's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=9930
View this thread:

http://www.excelforum.com/showthread...hreadid=262888

.



All times are GMT +1. The time now is 05:35 PM.

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