LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Simple password function - unprotecting sheets

Hello,
I have a problem where I have 1 protected cell on a sheet.
It is at the top of the sheet and it is for a 'supervisor'
to enter his name to say that he has checked the sheet.
Only the supervisor has the password to unprotect the
sheet so he can enter data into that protected cell.
Unfortunately, sometimes the people filling out the sheet
are wanting to insert extra rows, which I want them to be
able to do, but they can't because the sheet is protected.
So - I tried putting a command button on the sheet that
would unprotect the sheet, insert the desired number of
rows, then protect the sheet again
eg. {I don't mind that they can see the password in here
at the moment}

Dim Row_Count As Integer
Dim password
password = "checked"
ActiveSheet.Unprotect password
Row_Count = InputBox("Enter number of rows required.")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset
(Row_Count - 1, 0)).Select
Selection.EntireRow.Insert
ActiveSheet.Protect password, True, True, True

Unfortunately, when I try this, I get the following error:
"Unprotect method of worksheet class failed"

I can guess why - password.

Can anyone suggest as alternative way of having the sheet
unprotected so that rows can be inserted, yet that cell
still protected - even by a simple password for that
single cell?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting/Unprotecting all sheets with macro leads to "image" iss MikeR Excel Worksheet Functions 3 February 22nd 10 09:33 PM
Unprotecting Sheets Zee[_2_] New Users to Excel 6 November 26th 08 03:58 PM
Unprotecting password protected workbook Vnagpal Excel Discussion (Misc queries) 1 December 10th 05 06:33 AM
PROTECTING/UNPROTECTING SHEETS Maureen Excel Discussion (Misc queries) 1 January 6th 05 06:46 PM
Beta - unprotecting multiple sheets Rick[_15_] Excel Programming 1 September 14th 03 09:44 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"