mmaginniss
Technical User
I would like to disable the ability for users to rename the tabs at the bottom of an Excel page. Any ideas on how to do that?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public bChange As Boolean
Sub MakeList()
Dim wsList As Worksheet, lRow As Long
bChange = True
With Application
.DisplayAlerts = False
.ScreenUpdating = False
End With
On Error Resume Next
With Worksheets("MyVeryHiddenList")
.Visible = xlSheetVisible
.Delete
End With
Worksheets.Add
Set wsList = ActiveSheet
With wsList
.Name = "MyVeryHiddenList"
.Cells(1, 1).Value = "SheetNames"
.Cells(1, 2).Value = "CodeNames"
lRow = 2
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> .Name Then
.Cells(lRow, 1).Value = ws.Name
.Cells(lRow, 2).Value = ws.CodeName
lRow = lRow + 1
End If
Next
.Cells(1, 1).CurrentRegion.CreateNames _
Top:=True, _
Left:=False, _
Bottom:=False, _
Right:=False
.Visible = xlSheetVeryHidden
End With
bChange = False
End Sub
Private Sub Workbook_Open()
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If bChange Then Exit Sub
ptr = Application.Match(Sh.CodeName, Worksheets("MyVeryHiddenList").Range("CodeNames"), 0)
If Not IsError(ptr) Then _
Sh.Name = Application.Index(Range("SheetNames"), ptr, 1)
End Sub