How to add check mark in a cell with double clicking in Excel



There is a symbol known as a check mark that can be entered into a cell just like any text that you type. This implies that the check mark will be copied along with the cell whenever you copy the cell, and it will also be deleted along with the cell if you delete the cell. You can format it in the same ways as conventional text by adjusting the color and the size of the font. A checkmark, often known as a tick, is a mark that can be used to represent the word "Yes," to mention the word "Done," or to mention the word "Complete." If you are making use of a to-do list and want to indicate that something is finished, finished up, or checked off, the most effective method is to use a checkmark.

In most cases, you will need to open the Symbol dialogue box, look for the check mark symbol, and then manually enter it into the cell before you can insert a check mark into the cell. However, due to the fact that the Symbol dialogue box contains a large number of symbols, it is not very simple to locate the check mark symbol within it.

In this tutorial we are going to learn about VBA code to add checkmark with double click in a cell.

VBA Code to add checkmark with double click

Step 1

Open an excel sheet and Press Alt and F11 key (Alt+F11) to open Microsoft Visual Basic for Application windows. See the below given image.

Step 2

After that, select Insert > Module from the menu bar to bring up the popup Module window. See the below given image.

Step 3

After opening the Module Window, then type the following VBA code in it.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
   If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
      Application.EnableEvents = False
      If ActiveCell.Value = ChrW(&H2713) Then
         ActiveCell.ClearContents
      Else
         ActiveCell.Value = ChrW(&H2713)
      End If
      Cancel = True
   End If
   Application.EnableEvents = True
End Sub

See the below given image.

In above code, in the place of A1:A10, you can add your cell number as per your requirement.

To exit the Microsoft Visual Basic for Applications window and return to the worksheet, press the Alt+Q button on your keyboard simultaneously.

Now double click on any cell between A1 to A10, the checkmark will be put in by itself. If you double-click the cell again, the check mark you put in will be gone.


Advertisements