enter check mark with one click

T

touchngo

What I want to do is be able to click on a cell and a check mark appears and
if I click again it disappears.
Is this possible?

Thanks
 
M

Mike H

Hi,

right click your sheet tab, view code and paste this in. It works for a1 -
A10 so change to suit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
If IsEmpty(Target) Then
With Target
.Font.Name = "marlett"
.Value = "a"
End With
Else
Target.Value = ""
End If
End If
End Sub

Mike
 
R

Rick Rothstein

The only problem with using SelectionChange is you have to move focus to
another cell and then back again to correct a mistaken entry. Perhaps the OP
would consider double-clicking a cell to toggle the checkmark; that way,
focus could remain in the same cell and double clicking a second time could
reverse a mistaken entry. Using your code as a guide ('touchngo'... install
it the same way as Mike told you for his code)...

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Cancel = True
If IsEmpty(Target) Then
With Target
.Font.Name = "marlett"
.Value = "a"
End With
Else
Target.Value = ""
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top