ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   autofilter and worksheet protection (https://www.excelbanter.com/excel-programming/359609-autofilter-worksheet-protection.html)

dreamz[_38_]

autofilter and worksheet protection
 

for some reason, excel gives me the following error when i try to
execute an autofilter command on a protected worksheet:


run-time error '1004':

you cannot use this command on a protected sheet. etc. etc.


even though i set "allow all users of this worksheet to: use
autofilter" in the options dialog. what's wrong?


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565


Ron de Bruin

autofilter and worksheet protection
 
Hi dreamz

Before you protect the sheet turn on AutoFilter

See also
http://www.contextures.com/xlautofilter03.html#Protect


--
Regards Ron de Bruin
http://www.rondebruin.nl


"dreamz" wrote in message
...

for some reason, excel gives me the following error when i try to
execute an autofilter command on a protected worksheet:


run-time error '1004':

you cannot use this command on a protected sheet. etc. etc.


even though i set "allow all users of this worksheet to: use
autofilter" in the options dialog. what's wrong?


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565




William Horton

autofilter and worksheet protection
 
Protect the sheet with userinterface only turned on. Then in the visual
basic editor for that worksheet's property box ensure that enable autofilter
is set to True. To protect with userinterface only has to be done via a
macro but it only has to be done once and then you can get rid of the macro.
Press Alt & F11 to get to the visual basic editor.

ThisWorkbook.ActiveSheet.Protect userinterfaceonly:=True

"dreamz" wrote:


for some reason, excel gives me the following error when i try to
execute an autofilter command on a protected worksheet:


run-time error '1004':

you cannot use this command on a protected sheet. etc. etc.


even though i set "allow all users of this worksheet to: use
autofilter" in the options dialog. what's wrong?


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565



dreamz[_39_]

autofilter and worksheet protection
 

the filter has already been created on the sheet and, since i'm using
excel 2003, i checked the "autofilter" option in the dialog. it still
does not work.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565


dreamz[_40_]

autofilter and worksheet protection
 

thanks, william. worked like a charm

--
dream
-----------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...fo&userid=2646
View this thread: http://www.excelforum.com/showthread.php?threadid=53556


Ron de Bruin

autofilter and worksheet protection
 
Hi dreamz

Do you filter with code or manual

--
Regards Ron de Bruin
http://www.rondebruin.nl


"dreamz" wrote in message
...

the filter has already been created on the sheet and, since i'm using
excel 2003, i checked the "autofilter" option in the dialog. it still
does not work.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565




Ron de Bruin

autofilter and worksheet protection
 
See also the code on Debra's site in my reply

--
Regards Ron de Bruin
http://www.rondebruin.nl


"dreamz" wrote in message
...

thanks, william. worked like a charm!


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565




dreamz[_41_]

autofilter and worksheet protection
 

i filter with code.

everything works well now. my only remaining question is this: how can
i disable cell selection with the userinterfaceonly code? i want to
make it so that the end-user can click only those cells that i
designate.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=535565



All times are GMT +1. The time now is 05:28 PM.

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