Hello all
having some trouble with my macro, as it doesnt appear to be working.
I have a macro in place that changes the worksheet name based on the entry in cell E5.
for some odd reason, after i re-opened the file, it stopped working. i have the workbook protected thru a password (u can run the password to unprotect sheet). but can someone pls let me know why the workbook is not updating the worksheet name when i change the entries in cell E5?
I have the following formula in "this workbook"
Private Sub Workbook_Open()
For c = 1 To Sheets.Count
With Worksheets(c)
.Protect Password:="analyst", userinterfaceonly:=True
.EnableOutlining = True
End With
Next c
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
On Error GoTo Rename_Error
If Target.Address = "$E$5" And Len(Target.Value) <> 0 Then _
Sh.Name = Target.Value
Exit Sub
Rename_Error:
MsgBox "The sheet name could not be renamed. Please check " & vbCrLf & _
"that you did not use illegal characters."
End Sub
can someone pls advise..thx u
Bookmarks