ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   TAB NAME IN A WOORKBOOK REFER TO A CELL ON WORKSHEET (https://www.excelbanter.com/excel-discussion-misc-queries/143531-tab-name-woorkbook-refer-cell-worksheet.html)

[email protected]

TAB NAME IN A WOORKBOOK REFER TO A CELL ON WORKSHEET
 
CAN THE WORKSHEET OR TAB NAME REFER TO A CELL OR ADDRESS ON THE WORKSHEET?

JE McGimpsey

TAB NAME IN A WOORKBOOK REFER TO A CELL ON WORKSHEET
 
See

http://www.mcgimpsey.com/excel/event...efromcell.html

In article ,

wrote:

CAN THE WORKSHEET OR TAB NAME REFER TO A CELL OR ADDRESS ON THE WORKSHEET?


[email protected]

TAB NAME IN A WOORKBOOK REFER TO A CELL ON WORKSHEET
 
THANK YOU VERY MUCH WAS VERY HELPFUL AND WORKED GREAT.

"JE McGimpsey" wrote:

See

http://www.mcgimpsey.com/excel/event...efromcell.html

In article ,

wrote:

CAN THE WORKSHEET OR TAB NAME REFER TO A CELL OR ADDRESS ON THE WORKSHEET?



Han

TAB NAME IN A WOORKBOOK REFER TO A CELL ON WORKSHEET
 
Can someone modify this code to add a number after the sheet name if it a
duplicate?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const sNAMECELL As String = "A1"
Const sERROR As String = "Invalid worksheet name in cell "
Dim sSheetName As String

With Target
If Not Intersect(.Cells, Range(sNAMECELL)) Is Nothing Then
sSheetName = Range(sNAMECELL).Value
If Not sSheetName = "" Then
On Error Resume Next
Me.Name = sSheetName
On Error GoTo 0
If Not sSheetName = Me.Name Then _
MsgBox sERROR & sNAMECELL
End If
End If
End With
End Sub

And if I delete say a duplicate sheet (Sheet(1)) and copy another sheet and
can it change the duplicate sheet to Sheet(1) and so on?


All times are GMT +1. The time now is 05:06 AM.

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