Doubleclick

  • Thread starter Thread starter Jock
  • Start date Start date
J

Jock

If I double click a cell in column B, I'd like a tick to appear in the cell.
Formatting the font in a cell to Wingdings2 and using the character 'P' will
give a tick.
Any ideas?
 
Hi Jock,

You must past the code below into the worksheet Code that you want to
use.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
With Selection.Font
.Name = "Wingdings 2"
.Size = 10
End With
ActiveCell = "P"
End If

End Sub


Best regards,

Les Stout
 
Thanks Les. Works great until I password protect the worksheet.
The (amended) code below does the job but after every doubleclick although
the tick appears, so does a message saying the cell is protected and
therefore read only.
What a pain! Any ideas?

Private Sub Worksheet_BeforeSingleClick(ByVal Target As Range, Cancel As
Boolean)
ActiveSheet.Unprotect Password:="sulby"
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
ActiveCell = "P"
With Selection.Font
.Name = "Wingdings 2"
.Size = 10
End With
End If

ws_exit:
Application.EnableEvents = True
ActiveSheet.Protect Password:="sulby"
End Sub

Thanks
 
Back
Top