Apply check mark in cell when the mouse is clicked.

craigwojo

Active Member
Joined
Jan 7, 2005
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,
Looking for "how to" place a "checkmark" in a cell with just a mouse click. If it is pressed again, then the "checkmark" is removed. I know little about the radio buttons but don't know if that would work.

thank you and God bless,
Craig

Excel Subscription 365
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I would suggest using a double click instead of a single click to insert the check mark. This would prevent you from accidentally inserting a check mark if you mistakenly click the cell. If you want to use a single click, then do the following: right click the tab name for your sheet and click 'View Code'. Paste the first macro below into the empty code window that opens up. Close the code window to return to your sheet. If you want to use a double click, use the second macro instead. Please note that the code is written to use cell A1 as the target cell. Change the target cell (in red) to suit your needs.
Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    If Target = "" Then
        Target.Value = ChrW(&H2713)
    Else
        Target.ClearContents
    End If
End Sub
Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    If Target = "" Then
        Target.Value = ChrW(&H2713)
    Else
        Target.ClearContents
    End If
End Sub
 
Upvote 0
I would suggest using a double click instead of a single click to insert the check mark. This would prevent you from accidentally inserting a check mark if you mistakenly click the cell. If you want to use a single click, then do the following: right click the tab name for your sheet and click 'View Code'. Paste the first macro below into the empty code window that opens up. Close the code window to return to your sheet. If you want to use a double click, use the second macro instead. Please note that the code is written to use cell A1 as the target cell. Change the target cell (in red) to suit your needs.
Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    If Target = "" Then
        Target.Value = ChrW(&H2713)
    Else
        Target.ClearContents
    End If
End Sub
Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    If Target = "" Then
        Target.Value = ChrW(&H2713)
    Else
        Target.ClearContents
    End If
End Sub
Rich (BB code):
 
Upvote 0
Hi mumps,
Simple question... If I wanted to extend the range down the column, (let's say G5 through G100) what would I do?
 
Upvote 0
You are very welcome. :) You could simply use G:G so you don't have to worry about where the last row of data is.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top