I have created some buttons in my excel sheet to highlight cells when clicked. However, I also want to protect the document so that only certain cells can be modified. When I protect the document the buttons no longer work even though the specified cells aren't locked. I'm sure it is just some simple setting that I don't know about.
Here is the code for the highlighting button:
Here is the code for the highlighting button:
Sub highlightgreen()
'
' highlightgreen Macro
' highlights the current cell in green to denote passage through x-ray
'
' Keyboard Shortcut: Ctrl+g
'
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Offset(1, 0).Select
End Sub
'
' highlightgreen Macro
' highlights the current cell in green to denote passage through x-ray
'
' Keyboard Shortcut: Ctrl+g
'
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Offset(1, 0).Select
End Sub