Saltar al contenido principal

¿Cómo resaltar celda o fila con casilla de verificación en Excel?

Como se muestra a continuación, debe resaltar la fila o celda con la casilla de verificación. Cuando se marca una casilla de verificación, una fila o celda especificada se resaltará automáticamente. Pero, ¿cómo lograrlo en Excel? Este artículo le mostrará dos métodos para lograrlo.

Resalte celda o fila con casilla de verificación con formato condicional
Resalte celda o fila con casilla de verificación con código VBA


Resalte celda o fila con casilla de verificación con formato condicional

Puede crear una regla de formato condicional para resaltar la celda o fila con la casilla de verificación en Excel. Haz lo siguiente.

Vincular todas las casillas de verificación a una celda especificada

1. Debe insertar casillas de verificación en las celdas una por una manualmente haciendo clic en Developer > recuadro > Casilla de verificación (Control de formulario).

2. Ahora se han insertado casillas de verificación en las celdas de la columna I. Seleccione la primera casilla de verificación en I1, ingrese la fórmula = $ J1 en la barra de fórmulas y luego presione el Participar clave.

Consejo: Si no desea tener valores asociados en celdas adyacentes a casillas de verificación, puede vincular la casilla de verificación a la celda de otra hoja de trabajo, como = Hoja3! $ E1.

2. Repita el paso 1 hasta que todas las casillas de verificación estén vinculadas a las celdas adyacentes o celdas en otra hoja de trabajo.
Note: Todas las celdas vinculadas deben ser consecutivas y ubicarse en la misma columna.

Crear una regla de formato condicional

Ahora necesita crear una regla de formato condicional de la siguiente manera paso a paso.

1. Seleccione las filas que necesita resaltar con casillas de verificación, luego haga clic en Formato condicional > Nueva regla bajo el Inicio lengüeta. Ver captura de pantalla:

2. En el Nueva regla de formato cuadro de diálogo, debe:

2.1 Seleccione el Use una fórmula para determinar qué celdas formatear opción en el Seleccione un tipo de regla caja;

2.2 Ingrese la fórmula = SI ($ J1 = VERDADERO, VERDADERO, FALSO) en el Dar formato a los valores donde esta fórmula es verdadera caja;
      Or = SI (Hoja3! $ E1 = VERDADERO, VERDADERO, FALSO) si las casillas de verificación están vinculadas a otra hoja de trabajo.

2.3 Haga clic en Formato botón para especificar un color resaltado para las filas;

2.4 Haga clic en OK botón. Ver captura de pantalla:

Note: En la fórmula, $ J1 or $ E1 es la primera celda vinculada para las casillas de verificación, y asegúrese de que la referencia de celda se haya cambiado a columna absoluta (J1> $ J1 or E1> $ E1).

Ahora se crea la regla de formato condicional. Al marcar las casillas de verificación, las filas correspondientes se resaltarán automáticamente como se muestra en la captura de pantalla de fuelle.


Resalte celda o fila con casilla de verificación con código VBA

El siguiente código de VBA también puede ayudarlo a resaltar la celda o fila con la casilla de verificación en Excel. Haz lo siguiente.

1. En la hoja de trabajo, debe resaltar la celda o fila con la casilla de verificación. Haga clic derecho en el Ficha Hoja y seleccionar Ver código desde el menú contextual para abrir el Microsoft Visual Basic para aplicaciones ventana.

2. Luego copie y pegue el siguiente código VBA en la ventana Código.

Código de VBA: resalte la fila con la casilla de verificación en Excel

Sub AddCheckBox()
Dim xCell As Range
Dim xRng As Range
Dim I As Integer
Dim xChk As CheckBox
On Error Resume Next
InputC:
    Set xRng = Application.InputBox("Please select the column range to insert checkboxes:", "Kutools for Excel", Selection.Address, , , , , 8)
If xRng Is Nothing Then Exit Sub
If xRng.Columns.Count > 1 Then
    MsgBox "The selected range should be a single column", vbInformation, "Kutools fro Excel"
    GoTo InputC
Else
    If xRng.Columns.Count = 1 Then
        For Each xCell In xRng        
            With ActiveSheet.CheckBoxes.Add(xCell.Left, _
               xCell.Top, xCell.Width = 15, xCell.Height = 12)
               .LinkedCell = xCell.Offset(, 1).Address(External:=False)
               .Interior.ColorIndex = xlNone
               .Caption = ""
               .Name = "Check Box " & xCell.Row
            End With    
            xRng.Rows(xCell.Row).Interior.ColorIndex = xlNone                  
        Next        
    End If    
    With xRng    
     .Rows.RowHeight = 16    
    End With   
    xRng.ColumnWidth = 5#    
    xRng.Cells(1, 1).Offset(0, 1).Select    
    For Each xChk In ActiveSheet.CheckBoxes   
      xChk.OnAction = ActiveSheet.Name + ".InsertBgColor"      
    Next
End If
End Sub

Sub InsertBgColor()
Dim xName As Integer
Dim xChk As CheckBox
For Each xChk In ActiveSheet.CheckBoxes 
  xName = Right(xChk.Name, Len(xChk.Name) - 10) 
  If (xName = Range(xChk.LinkedCell).Row) Then   
   If (Range(xChk.LinkedCell) = "True") Then   
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = 6    
   Else    
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = xlNone  
   End If  
  End If
Next
End Sub

3. presione el F5 clave para ejecutar el código. (Note: debe colocar el cursor en la primera parte del código para aplicar la tecla F5) En la ventana emergente Kutools for Excel cuadro de diálogo, seleccione el rango que desea insertar casillas de verificación y luego haga clic en el OK botón. Aquí selecciono el rango I1: I6. Ver captura de pantalla:

4. Luego, se insertan casillas de verificación en las celdas seleccionadas. Marque cualquiera de las casillas de verificación, la fila correspondiente se resaltará automáticamente como se muestra a continuación.


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 (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is a horrendous article. It lacks a lot of information and steps. If you follow this article verbatim it will not end in the result you are seeking.

Essentially the article is saying to have 2 columns where the checkboxes are linked to adjacent columns to enter in values which are then used for conditional formats. No one wants to have values associated in adjacent cells to checkboxes. Lastly, if this is the route you're going you're not linking checkboxes to conditional formats, you are linking checkboxes to cell values which are then in turn associated to conditional formats.

It is easier to just use icons instead of checkboxes (use the green checkmark icon) and create the conditional formats for a value of 1 or 0. If cell = 1 then it will replace the value with the icon and highlight your row. To accomplish this you use 2 conditional formats on your table.

Top left of table is B4, bottom right of table is L28

1st conditional format:
USE A FORMULA TO DETERMINE WHICH CELLS TO FORMAT
Formula: =$B4=1
Format: fill
Applies to: =$B4:$L28

2nd conditional format:
FORMAT CELLS BASED ON THEIR VALUES
Icon Set Custom
SHOW ICON ONLY (check this box off)
First icon (green checkmark) when value is > = 1 (type: number)
Second icon (no icon) when value is > = -1 (type: number)
Third icon (no icon) when < -1

Now, when I enter a 1 in B4 or any of the B column cells, it will highlight the entire row for me and replace the "1" with a checkmark.

BUILT-IN TEMPLATE WITH THIS FORMATTING:
1) Open Excel, search for a new template. Enter "Inventory" as the search term
2) Select the template titled "Inventory list with highlighting"
3) Highlight the first row of the table, open conditional formats to manage/edit. You will see the 2nd and 3rd formats are for highlights and the icon in the B column. You can change the icon to whatever you want. Remove the first format if you don't want the strikeout options from the Discontinued column.
This comment was minimized by the moderator on the site
I have a question about the initial step of linking the checkbox to a true/false.

1. Select the first check box in I1, enter formula =$J$1 into the formula bar, and then press the Enter key.

2. Repeat step 1 until all check boxes are linked to the adjacent cells.

For the repeat, does it have to be done for each cell or can you get the drag down to autofill? Right now, when I drag down the corner box it will autofill with =$J$1 for everything so that if I check one box, every box is checked. How can I fix this without manually linking each checkbox?
This comment was minimized by the moderator on the site
Hi,
The Fill Handle can't help in this case. You need to manually link each checkbox to its adjacent cell.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations