ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Custom Filter that Displays All But in Ascending or Decending Orde (https://www.excelbanter.com/excel-discussion-misc-queries/45191-custom-filter-displays-all-but-ascending-decending-orde.html)

Kim

Custom Filter that Displays All But in Ascending or Decending Orde
 
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

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

On Tue, 13 Sep 2005 14:28:18 -0700, Kim wrote:

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



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


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=467269


Kim

Thank you Thank you Thank you to both.

"dominicb" wrote:


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


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=467269




All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com