Custom Filter that Displays All But in Ascending or Decending Orde

G

Guest

I have a worksheet that is password protected. The creator of the sheet
would like her users to be able to sort the data without unlocking the cells
(don't want others to edit the content) which is not possible in Excel. I
have tried recroding a macro to unprotect the sheet, perform a SORT and the
reprotect the sheet -- but the users are still prompted to enter a password
to unprotect the sheet.

The creator has also added an Auto Filter to the sheet which works while
protected. Is there a way to create a custom AutoFilter that will display
all entries in alphabetical order? -- similar to a sort?

Thanks. Kim
 
G

Gord Dibben

Do not know how to sort a Autofilter.

Why not change the macro so's it doesn't ask for a password?

Sub Sort_stuff()
ActiveSheet.UnProtect Password:="justme"

'your code to do the sorting

ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowFiltering:=True
End Sub


Gord Dibben Excel MVP
 
D

dominicb

Good evening Kim

In short, no. But you were on the right lines by writing a macro that
will unprotect the sheet, sort the contents and reprotect it. You just
need to specify the password (in the example below, pword1) to Excel,
thus:

ActiveSheet.Unprotect Password:="pword1"

and something like this to reprotect it:

ActiveSheet.Protect Password:="pword1"

HTH

DominicB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top