Hello,
Someone can help me with this?
I have a Workbook and I do not want to change the name to the Sheets.
Thanks.
Hello,
Someone can help me with this?
I have a Workbook and I do not want to change the name to the Sheets.
Thanks.
Maybe, from menu Tools/Protection/Protect workbook/ check Structure and OK.
Is OK?
Artik
I'm afraid I don't understand the question. Can you clarify your request?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
forgiveness for not explicitly state the question.Originally Posted by lucas
I have a workbook that has 3 sheets called
Cash Flow
Tescmv
Catalogo
What I want is that VBA is not permitted to change the name of the worksheets.
Greetings.
If someone can run vba code in the workbook then this will be very hard to prevent.
Artik has suggested the only method that would come close but that prevents users from changing anything in the workbook.
Maybe I misunderstand still......is it possible that you want to protect the workbook or sheet using vba?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
There is one clever way to prevent this although it will seem absurd. You could write a naming macro for every possible event associated with the worksheet and then protect the vba editor/project with a password. See below.....
Private Sub Worksheet_Activate()
ThisWorkbook.Worksheets(1).Name = "Sheet1"
End Sub
Where "Activate" in the Private Sub title could be replaced by "Deactivate", "SelectionChange", "Change", etc,
This is just an off the top solution.....but remember that when you must protect the VBA code part of this workbook (the vba project).
Let me know if this works!
Ischyros, that's a good idea.
Rather than using the index, which can be changed by moving sheets, the code name, which can't be changed, could be used.
[VBA]Sheet1.Name = "Sheet1" [/VBA]
Its not clear to me that the OP wants to protect his workbook from VBA code. If he is only protecting himself against the user's keyboard and mouse, your routine (expanded to "rename" all sheets) could be put in ThisWorkbook's Workbook_SheetActivate event.