PW Protected Workbook Sturcture Issue

r0bism123

Board Regular
Joined
Feb 8, 2018
Messages
57
Hello,

I'm having an issue that I hoping someone can help me out. I've posted on this issue before but I cannot seem to make it work.

Here is the URL to the other string: https://www.mrexcel.com/forum/excel...ect-workbook-structure-issue.html#post5109213

I have a workbook that has about 60ish password protected sheets. One of these sheets controls the names of the different tabs by executing the code below. In short, I change the name from "Suite 1" to "Suite 2" and the corresponding tab also changes in the proper order. The code below works perfectly fine when the workbook structure is not protected, however, when the workbook structure is protected, it stops working and will not change the name of the tab.

I am hoping there is a workaround that will unprotect the workbook structure, execute the code below, then password protect the sheet and password protect the workbook structure once again.

Just so am I clear as possible, I took of screen shot of the "workbook structure" menus.

Any help is greatly appreciated!

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Dim ans As Long
On Error GoTo M
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
    If Target.Row > 15 Then
            ans = Target.Row
            If Target.Value = "Vacant" Or Target.Value = "vacant" Then
                Sheets(ans + 1).Tab.Color = RGB(255, 76, 76)
                Sheets(ans + 1).Name = Sheets(ans + 1).Cells(5, 3).Value
            Else
                Sheets(ans + 1).Tab.Color = RGB(255, 248, 66)
                Sheets(ans + 1).Name = Target.Value
             End If
        End If
    End If
   
Exit Sub
M:
MsgBox "Error: Duplicate Tenant Name"
End Sub

ss1.jpg
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top