ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Workbook/worksheets protected- can I allow tab re-naming? (https://www.excelbanter.com/excel-discussion-misc-queries/195577-workbook-worksheets-protected-can-i-allow-tab-re-naming.html)

Roady

Workbook/worksheets protected- can I allow tab re-naming?
 
Hi:

I protected my workbook so that people cannot delete sheets. However, I want
to allow them to re-name sheets. The way that I did it doesn't seem to allow
both. Can you help? thank you!

Gord Dibben

Workbook/worksheets protected- can I allow tab re-naming?
 
Something similar to this not too well error-trapped macro.

Sub rename_sheet()
On Error GoTo endit
newname = InputBox("type a name")
If newname < "" Then
ActiveWorkbook.Unprotect
ActiveSheet.Name = newname
End If
ActiveWorkbook.Protect
Exit Sub
endit:
MsgBox "not a valid name. try again"
ActiveWorkbook.Protect
End Sub


Gord Dibben MS Excel MVP

On Sun, 20 Jul 2008 09:29:12 -0700, Roady
wrote:

Hi:

I protected my workbook so that people cannot delete sheets. However, I want
to allow them to re-name sheets. The way that I did it doesn't seem to allow
both. Can you help? thank you!



Roady

Workbook/worksheets protected- can I allow tab re-naming?
 
Thank you, that works great! However, is there anyway to alter the verbiage
in the pop up box that appears when the user tries to click on the tab
directly to rename it. Right now, it defaults to saying, "workbook is
protected and cannot be changed". I would like to be able to have it say
something like, "If you wish to re-name the tab, please use macro button
located on top right of worksheet"

Thanks again!
R

"Gord Dibben" wrote:

Something similar to this not too well error-trapped macro.

Sub rename_sheet()
On Error GoTo endit
newname = InputBox("type a name")
If newname < "" Then
ActiveWorkbook.Unprotect
ActiveSheet.Name = newname
End If
ActiveWorkbook.Protect
Exit Sub
endit:
MsgBox "not a valid name. try again"
ActiveWorkbook.Protect
End Sub


Gord Dibben MS Excel MVP

On Sun, 20 Jul 2008 09:29:12 -0700, Roady
wrote:

Hi:

I protected my workbook so that people cannot delete sheets. However, I want
to allow them to re-name sheets. The way that I did it doesn't seem to allow
both. Can you help? thank you!





All times are GMT +1. The time now is 02:44 AM.

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