Run-time error '1004': Application-Defined or Object defined error.

gradyshock

New member
Joined
Aug 20, 2013
Messages
2
Reaction score
0
Points
0
Hello,

I'm getting a Run-time error '1004': Application-Defined or Object defined error. When ever I click a cell. I have the following code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$M$6" Then
If Target.Value = "Length" Then
Target.Font.ColorIndex = 15
Target.Value = ""
Exit Sub
End If
End If

If [M6].Value = "" Then
[M6].Value = "Length"
[M6].Font.ColorIndex = 15
Else
[M6].Font.ColorIndex = xlAutomatic
End If
End Sub

Is there a way I can attach my worksheet for review?
 

gradyshock

New member
Joined
Aug 20, 2013
Messages
2
Reaction score
0
Points
0
In case it helps anyone my problem was sheet protection wasn't allowing the cells to be formatted...
 
Top