View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Filter a protected shared worksheet

This code worked for you in a shared workbook (tools|share workbook type
sharing)?



Neill wrote:

Excellent 1st time I,ve post to a newsgroup & your answer works perfect, many
thanks.
--
Neill

"broro183" wrote:

hi Neill,
Have you tried the "user interface only" approach of protecting sheets?
(I haven't tested this on a shared file)

'copy this into the "thisworkbook" code window
Option Explicit
Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect UserInterfaceOnly:=True
Next ws
End Sub

To see the other arguments/parameters that can be set when protecting
sheets, select "protect" & press [F1] in the VB Editor. My understanding is
that the "user interface" option needs to be reset every time the file is
opened which is I've put it in the thisworkbook code section.

hth
Rob

Rob Brockett
NZ
Always learning & the best way to learn is to experience...


"Neill" wrote:

How can I filter a protected shared worksheet?
I have allowed filtering in protection & can filter the protected worksheet
manually but if I try using vba it says its protected. I can't unprotect then
filter because it's a shared workbook.

Command used to try to filter is:
Selection.AutoFilter Field:=3, Criteria1:="LK", VisibleDropDown:=False
--
Regards
Neill


--

Dave Peterson