Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect sheet using vba
Hi,
If I manually protect a sheet and select use auto filter, that function can be used when the sheet is protected. Using a private sub, if I unprotect the sheet, allowing changes to be made, and then re-protect it, the facility to use auto filter is lost. Is there a line I can add to this: Private Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.Unprotect Password:="sulby" On Error GoTo ws_exit: Application.EnableEvents = False "my changes" ws_exit: Application.EnableEvents = True 'ActiveSheet.Protect Password:="sulby" End Sub to keep the autofilter functionality? Thanks, -- Traa Dy Liooar Jock |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect sheet using vba
In XL2003:
ActiveSheet.Protect Password:="sulby", _ AllowFiltering:=True Hope this helps, Hutch "Jock" wrote: Hi, If I manually protect a sheet and select use auto filter, that function can be used when the sheet is protected. Using a private sub, if I unprotect the sheet, allowing changes to be made, and then re-protect it, the facility to use auto filter is lost. Is there a line I can add to this: Private Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.Unprotect Password:="sulby" On Error GoTo ws_exit: Application.EnableEvents = False "my changes" ws_exit: Application.EnableEvents = True 'ActiveSheet.Protect Password:="sulby" End Sub to keep the autofilter functionality? Thanks, -- Traa Dy Liooar Jock |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect sheet | Excel Programming | |||
Protect Workbook Vs Protect Sheet | New Users to Excel | |||
Can I protect columns w/in a "List" using Protect Sheet? | Excel Discussion (Misc queries) | |||
Lock and protect cells without protect the sheet | Excel Programming | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming |