Saltar al contenido principal

¿Cómo agregar una marca de verificación en una celda con doble clic en Excel?

Normalmente, para insertar una marca de verificación en una celda, debe ingresar al cuadro de diálogo Símbolo, buscar el símbolo de la marca de verificación e insertarlo manualmente. Pero no es tan fácil encontrar el símbolo de marca de verificación en el cuadro de diálogo Símbolo, ya que hay numerosos símbolos enumerados en el interior. ¿Cómo agregar rápidamente una marca de verificación en una celda en Excel? Este artículo le mostrará un método VBA para agregar fácilmente una marca de verificación en una celda con solo hacer doble clic.

Haga doble clic para agregar una marca de verificación en una celda con código VBA


Haga doble clic para agregar una marca de verificación en una celda con código VBA

El siguiente código VBA puede ayudarlo a agregar una marca de verificación en una celda haciendo doble clic. Haz lo siguiente.

1. Abra la hoja de trabajo que necesita para agregar una marca de verificación en la celda, luego haga clic derecho y seleccione Ver código desde el menú contextual.

2. En el Microsoft Visual Basic para aplicaciones ventana, copie y pegue el siguiente código VBA en el Código ventana.

Código de VBA: haga doble clic para agregar una marca de verificación en una celda

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("B1:B10")) 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

Note: En el código, B1: B10 es el rango que agregará la marca de verificación haciendo doble clic. Cámbielo según sus necesidades.

3. presione el otro + Q llaves para cerrar el Microsoft Visual Basic para aplicaciones ventana y vuelva a la hoja de trabajo.

Ahora, haga doble clic en cualquier celda en el rango B1: B10, la marca de verificación se ingresará automáticamente. Y haciendo doble clic en la celda nuevamente, se eliminará la marca de verificación insertada.

Si necesita utilizar con frecuencia las marcas de verificación en su trabajo diario de Excel, aquí le recomiendo el Texto automático Utilidad de Kutools for Excel. Con esta función, puede guardar una marca de verificación como una entrada de texto automática y luego reanudarla en el futuro con solo un clic en Excel, como se muestra en la siguiente demostración.
¡Descárgalo y pruébalo ahora! (Pista gratuita de 30 días)


Artículos relacionados:

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
Comments (13)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
hello bro, is it possible to add an icon?
for example double-click the first checklist icon ,and if you double click the second cross icon appears ,and double click the last to go blank .
Rated 5 out of 5
This comment was minimized by the moderator on the site
Bonjour,

Une fois ces cases cochées, j'aimerais qu'une cellule x m'additionne les chiffres d'une certaine colonne, est ce possible ?

Merci à vous, bonne soirée
This comment was minimized by the moderator on the site
How do I make it so that it adds a time stamp on the adjacent cell after the double click?
This comment was minimized by the moderator on the site
Hi Sora,
The following VBA code can do you a favor. Please give it a try. Thank you.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Updated by Extendoffice 20221125
    Dim xRight As Range
    Dim KeyCells As Range
    Set KeyCells = Range("B1:B10")
    Set xRight = Target.Offset(0, 1)
    If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
        xRight.Value = Now()
    End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
Eu gostaria de saber se é possível adicionar a marca com apenas um clique ao invés de dois.
This comment was minimized by the moderator on the site
Hi Ulisses Nonato,
If you want to add a check mark to a cell with only one mouse click, the following VBA code can do you a favor.
You need to click the right mouse button to activate the code.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    'Updated by Extendoffice 20220714
    If Not Intersect(Target, Range("B1:B10")) 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
This comment was minimized by the moderator on the site
How do i repeat this for multiple columns? 
For example i need it in the following:
E, F, I, J, M, N ,Q, R, U, V, Y, Z, AC, AD, AG, AH, AK, AL, AO, AP, AS, AT, AW, AX
This comment was minimized by the moderator on the site
Hi crystal
is there a way to have checkmarks in A1:A10 along with B3:B10?
This comment was minimized by the moderator on the site
Hi there! What would I add to the above code to get the cell to change color when the check box is added?
This comment was minimized by the moderator on the site
Is there a way to loop this code so that it is on a lot of worksheets in one workbook?
This comment was minimized by the moderator on the site
Hi leoflute,After pressing the Alt + F11 keys to open the Microsoft Visual Basic for Applications window, please double click ThisWorkbook to open the ThisWorkbook(Code) window, and then copy the below code into the code window. Don't forget to change the sheet names and the cell range in the code.<div data-tag="code">Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
'Updated by Extendoffice 20201012
Dim xStrRg, xStrWs, xStrWsName As String
Dim xEEBol, xWSNBol, xBol As Boolean
Dim xArrWs
Dim xArrRg
Dim xI, xJ As Integer
Dim xWs As Worksheet
Dim xRg As Range

xStrWs = "Sheet5,Sheet1,Sheet2" 'The specific worksheet names
xStrRg = "B3:B10" 'The range of cells you will insert check marks
xArrWs = Split(xStrWs, ",")
xArrRg = Split(xStrRg, ",")

xEEBol = Application.EnableEvents
Application.EnableEvents = False
On Error Resume Next
xStrWsName = Sh.Name
xBol = False
xWSNBol = False
For xI = 0 To UBound(xArrWs)
If xStrWsName = xArrWs(xI) Then
xWSNBol = True
Exit For
End If
Next xI

If xWSNBol Then
Set xWs = Application.Worksheets.Item(xArrWs(xI))
For xJ = 0 To UBound(xArrRg)
Set xRg = Sh.Range(xArrRg(xJ))
If Not Intersect(Target, xRg) Is Nothing Then
xBol = True
Exit For
End If
Next xJ
End If

If xBol Then
If ActiveCell.Value = ChrW(&H2713) Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ChrW(&H2713)
End If
Cancel = True
End If
Application.EnableEvents = xEEBol
End Sub

This comment was minimized by the moderator on the site
como eu faço pra inserir a marca de seleção na célula, porém sem deletar o número que estiver digitado nela ou seja, a marca sairia na frente do número quando eu der duplo clique... e quando eu quizer apagar a marca, eu dou duplo clique novamente e a célula voltaria ao normar (continuaria apenas o número).
This comment was minimized by the moderator on the site
Ola Luiz, tente essa alteracao. Ira funcionar nas celulas A2:A10 e D2:D5, altere conforme sua necessidade.

Tadao


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Union(Range("A2:A10"), Range("D2:D5"))) Is Nothing Then
Application.EnableEvents = False
If Left(ActiveCell.Value, 1) = ChrW(&H2713) Then
ActiveCell.Value = Right(ActiveCell, Len(ActiveCell) - 1)
ActiveCell.HorizontalAlignment = xlRight
Else
ActiveCell.Value = ChrW(&H2713) & ActiveCell.Value
End If
Cancel = True
End If
Application.EnableEvents = True
End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations