events / double-click

G

grt

hi,
is it somehow possible to create a checkmark if a cell is double-clicked?
On double-click ----> ?

??
 
B

Bernard Rey

grt wrote :
is it somehow possible to create a checkmark if a cell is double-clicked?
On double-click ----> ?

There's a "BeforeDoubleClick" worksheet event to be found in the codesheet
(control click on the sheet tab). You can use it to add a sign or something
of the kind above the cell. It depends upon what exactly you intend to do.
 
B

Bob Greenblatt

hi,
is it somehow possible to create a checkmark if a cell is double-clicked?
On double-click ----> ?

??
Sure it is. Paste the following into the worksheet's code pane for the sheet
where you want this to occur. Note that for this sheet you will no longer
be able to edit directly in the cell as a double click will simply enter the
checkmark. (Watch the line wrap when you paste the code)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)
Target = Chr(195)
Cancel = True
End Sub
 
G

grt

thanks for your feedback. It works! Is it not possible to specifiy the double-
clickable cells. For example only double-click in a cell in column F would
give the checkmark as a result?
tia,
grt
 
J

JE McGimpsey

grt said:
thanks for your feedback. It works! Is it not possible to specifiy the double-
clickable cells. For example only double-click in a cell in column F would
give the checkmark as a result?

One way:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
If .Column = 6 Then
.Value = Chr(195)
Cancel = True
End If
End With
End Sub
 
G

grt

-----Original Message-----


One way:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
If .Column = 6 Then
.Value = Chr(195)
Cancel = True
End If
End With
End Sub
.
hi again,
guess I'm almost there with getting my grip on VBA. Entering a checkmark
via the solution as offered above works great for mac users. Though
windows users get some sort of A with ~ (tilde) above it. I could have the
colour of the cell changed but I like the checkmark as it is cleaner for
printing purposes.
rdgs
 

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