Hello All

I am extremely new to VBA code & would very much appreciate a little help

I have set up a worksheet which has a macro for checkboxes & also some code to hide various autofilter arrows. This all works fine until I manually Protect the worksheet. I want to protect the sheet so users can not select locked cells, but can insert Hyperlinks & use Autofilters. With Protection on I get runtime error 1004 when using the check boxes. I have since changed the macro to unprotect & then protect after running, which gets rid of the runtime error but now I can select locked cells & I cant insert Hyperlinks or use the autofilter. I understand that when it is protecting itselg again after running the macro it is "standard" protection setting that are being applied & I therefore need to uncheck the Select Locked Cells & Check The AllowHyperlinks & AllowAutofilters, But I am struggling to get it right.

Any Ideas

Many Thanks in advance

P.S. Please see below my macro & code as it stands

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Sheet1.Unprotect Password:=3581
If (ActiveCell.Column = 22 Or ActiveCell.Column = 25 Or ActiveCell.Column = 28 Or ActiveCell.Column = 35 Or ActiveCell.Column = 40 Or ActiveCell.Column = 43 Or ActiveCell.Column = 47) And _
ActiveCell.Row > 23 Then
If ActiveCell.Value = "P" Then
ActiveCell.Value = ""
Else
ActiveCell.Value = "P"
ActiveCell.Font.Name = "Wingdings 2"
End If
ActiveCell.Offset(0, 1).Select
End If
Sheet1.Protect Password:=3581
End Sub
Sub HideArrowsRange()
Dim c As Range
Dim i As Integer
Dim rng As Range
Set rng = Range("B22:AW22")
i = rng.Cells(1, 1).Column - 1
Application.ScreenUpdating = False

For Each c In Range("B22:AW22")
Select Case c.Address
Case "$B$22", "$C$22", "$D$22", "$F$22", "$G$22", "$H$22", "$I$22", "$J$22", "$K$22", "$L$22", "$M$22", "$N$22", "$P$22", "$R$22", "$T$22", "$U$22", "$W$22", "$X$22", "$Z$22", "$AA$22", "$AC$22", "$AD$22", "$AE$22", "$AF$22", "$AG$22", "$AH$22", "$AJ$22", "$AK$22", "$AL$22", "$AM$22", "$AO$22", "$AP$22", "$AR$22", "$AS$22", "$AT$22", "$AV$22"
c.AutoFilter Field:=c.Column - i, _
Visibledropdown:=False
Case Else
c.AutoFilter Field:=c.Column - i, _
Visibledropdown:=True
End Select
Next

Application.ScreenUpdating = True
Sheet1.Protect Password:=3581
End Sub