Password Protection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Guest
I have a spread sheet that I have password protected from changes in the format but it will not allow users to sort. Is there a way to protect the format and still allow sorting?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Thanks for the info, I tried the macro and it still asks for the password. and unfortunately the office is not ready to go XP for all of us yet
 
Upvote 0
Hi
Ermm i have tried this one and yep E97 dont like it XP will allow >> Update and improvements but that no help to you, a fix you need.

All i can think of is a macro to switch OFF all protection to allow sort and then bang protection on at end of script.. thus no other amendments can be made, ie you trigget the sort and close protected on command button

Any good?
 
Upvote 0
I don't think I understand, this is the macro I wrote, but it still asks for the password when you run it in Excel 2000

,Sub DateSort()
'
' DateSort Macro
' Macro recorded 2/26/2002 by PEileen
'
' Keyboard Shortcut: Ctrl+d
'
ActiveSheet.Unprotect
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

I really do appreciate any help you can give, these users are driving me nuts on this!
 
Upvote 0
In the sheet module put:

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Macro by Joseph S. Was
'
Application.EnableEvents = False

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="admin"
Application.EnableEvents = True
End Sub

Then in a module add the unlock code and attach your sort code, befor the End Sub.

Sub myUnLock()
'This code will unprotect the sheet.
Application.EnableEvents = False
Application.DisplayAlerts = False
ActiveSheet.Unprotect ("admin")

'Add optional code here!

Application.EnableEvents = True
Application.DisplayAlerts = True

End Sub

Then run your code out of the unlock sub, the first macro will password lock the code behind you. Note: this uses hard coded password protection which will decrease the security of the protection. But then again a password does not really deter someone from getting in if they want to, like a door lock does not stop some one from getting in a window, but does stop the causal passer-by from coming in. JSW
 
Upvote 0

Forum statistics

Threads
1,223,323
Messages
6,171,467
Members
452,406
Latest member
kken tthompson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top