Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doing a sorting out on a locked sheet.

Status
Not open for further replies.

VBASHA

Programmer
Apr 17, 2003
2
FR
Could you please tell me how to sort out values while my excel sheet is blocked. When I click on my push button for sorting out, it results in an error.

Thanks in advance.

Shameem
 
Can't sort whilst the sheet is protected
Presumably, you have some code attached to a button that does the sort...
before the sort code have the line
activesheet.unprotect password:="password"
and after the sort code
activesheet.protect password:="password"

obviously, change "password" to whatever the sheet's password is...

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
There is also an additional parameter to Protect
"UserInterfaceOnly:=True" which prevents the user changing the worksheet but allows it to be changed by macros. It is reset when the file is loaded so you need to put it in the Auto_Open macro if you want it implemented each time the workbook is loaded.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top