Help!! macro unprotect


Posted by Marc on November 12, 2001 11:35 AM

I've created a protected worksheet, with an autofilter.
I have also written a macro that unprotects the sheet first an then selects the autofilter function ( non blanks).
here's the macro:
Private Sub Commandbutton-Click()
ActiveSheet.Unprotect ("password")
Selection.AutoFilter Field:=1, Criterial:="<>"<br>End Sub

I created this macro in office 2000, I tryed to run this macro at work, there we use office 97 , and it does not run anymore?

It can't unprotect the sheet, and it also does not run the autofilter option.

Please help.
Marc.




Posted by Barrie Davidson on November 12, 2001 11:42 AM

Try changing the name of the macro. Something like:

Private Sub Commandbutton_Click()
ActiveSheet.Unprotect ("password")
Selection.AutoFilter Field:=1, Criterial:="<>"<br>End Sub

The use of the dash "-" is not allowed in a macro name in Excel 97 (not sure about Excel 2000).

Regards,
BarrieBarrie Davidson