Hi,
I need help again, but I am learning a lot from you guys!
I have just applied protection to certain cells within a worksheet.
The required cells are protected and others are not.
However in some unprotected cells I have a sub to toggle "ticks" in the box see below:
"Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B7:D1000")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End Sub"
Whenever I click on one of these cells, the "ticks" do not toggle and I get the following error:
"Runtime error 1004
Unable to set the name property of the font class".
If I Unprotect the sheet it works fine.
Clearly the protection function is screwing up the font change in the sub, but I am stuck on why or how as I thought that I had strictly limited the protection to just specific cells. I have found some references to this error but no real conclusion as to the best solution?
Thanks,
Mike
I need help again, but I am learning a lot from you guys!
I have just applied protection to certain cells within a worksheet.
The required cells are protected and others are not.
However in some unprotected cells I have a sub to toggle "ticks" in the box see below:
"Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B7:D1000")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End Sub"
Whenever I click on one of these cells, the "ticks" do not toggle and I get the following error:
"Runtime error 1004
Unable to set the name property of the font class".
If I Unprotect the sheet it works fine.
Clearly the protection function is screwing up the font change in the sub, but I am stuck on why or how as I thought that I had strictly limited the protection to just specific cells. I have found some references to this error but no real conclusion as to the best solution?
Thanks,
Mike