on double click change cell color
:)
Thanks Tom. I'm not feeling pretty smart right now...
"Tom Ogilvy" wrote:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
'on double click change color to show selection
If Target.Address = "$A$15" Then
With Target.Interior
.ColorIndex = 42
.Pattern = xlSolid
End With
Cancel = True
End If
End Sub
You misspelled the constant xlSolid
--
Regards,
Tom Ogilvy
"gaba" wrote in message
...
I put this code in the worksheet's code module
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
'on double click change color to show selection
If Not Intersect(Target, Range("A15")) Is Nothing Then
Target.Select
With Selection.Interior
.ColorIndex = 42
.Pattern = xSolid
End With
Cancel = True
End If
End Sub
But the Target is not changing to the desired color. I've tried to change
the Range part to other values and nothing works.
Can anybody see what I'm doing wrong?
As usual any help will be most appreciated!
--
gaba :)
|