H Hamidam Aug 7, 2006 #1 Well, I guess the title says it all... Locking a sheet from being deleteable!??? Thanks / Jennifer
D Dave Peterson Aug 7, 2006 #2 Tools|protect|protect workbook (Protect the structure) No sheet will be able to be moved/deleted/inserted/renamed
Tools|protect|protect workbook (Protect the structure) No sheet will be able to be moved/deleted/inserted/renamed
H Hamidam Aug 7, 2006 #4 Well, now the option of renaming the sheet disappears... they ar supposed to represent company name... hmm... Jennife
Well, now the option of renaming the sheet disappears... they ar supposed to represent company name... hmm... Jennife
D Dave Peterson Aug 7, 2006 #5 Yep. That's why I included this warning: No sheet will be able to be moved/deleted/inserted/renamed Maybe you can provide a macro that would unprotect the workbook, rename the activesheet, and then reprotect the workbook. Something like: Option Explicit Sub testme01() Dim myResp As String Dim PWD As String Dim myErrorNumber As Long PWD = "passwordhere" myResp = InputBox(Prompt:="Please enter new name for: " & vbLf & _ ActiveSheet.Name) If Trim(myResp) = "" Then Exit Sub End If ActiveWorkbook.Unprotect Password:=PWD On Error Resume Next ActiveSheet.Name = myResp myErrorNumber = Err.Number Err.Clear On Error GoTo 0 ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:=PWD If myErrorNumber <> 0 Then MsgBox "Invalid name, please try again!" End If End Sub
Yep. That's why I included this warning: No sheet will be able to be moved/deleted/inserted/renamed Maybe you can provide a macro that would unprotect the workbook, rename the activesheet, and then reprotect the workbook. Something like: Option Explicit Sub testme01() Dim myResp As String Dim PWD As String Dim myErrorNumber As Long PWD = "passwordhere" myResp = InputBox(Prompt:="Please enter new name for: " & vbLf & _ ActiveSheet.Name) If Trim(myResp) = "" Then Exit Sub End If ActiveWorkbook.Unprotect Password:=PWD On Error Resume Next ActiveSheet.Name = myResp myErrorNumber = Err.Number Err.Clear On Error GoTo 0 ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:=PWD If myErrorNumber <> 0 Then MsgBox "Invalid name, please try again!" End If End Sub
H Hamidam Aug 7, 2006 #6 Oooh thanks again Dave... her is a snapshot of the final result now tha Iam finished and since you have been with me from the beginning! Thanks / Jennife +------------------------------------------------------------------- |Filename: Snapshot.GIF |Download: http://www.excelforum.com/attachment.php?postid=5159 +-------------------------------------------------------------------
Oooh thanks again Dave... her is a snapshot of the final result now tha Iam finished and since you have been with me from the beginning! Thanks / Jennife +------------------------------------------------------------------- |Filename: Snapshot.GIF |Download: http://www.excelforum.com/attachment.php?postid=5159 +-------------------------------------------------------------------
D Dave Peterson Aug 8, 2006 #7 I'm one (of many) who don't connect through excelforum. So I can't see the picture. But I'm glad you got it working.
I'm one (of many) who don't connect through excelforum. So I can't see the picture. But I'm glad you got it working.