Agregar checkbox automaticamente si la celda A tiene valor
Tengo una macro que agrega un checkbox en la columna A despues de dar enter. Quisiera que la macro evalue por si sola y agregue los checkbox de forma automatica. La macro con la que cuento es
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Dim chkbox As CheckBox
Dim cell As Range
If Not Intersect(Target, Range("A10:A1000")) Is Nothing Then
For Each cell In Intersect(Target, Range("A10:A1000"))
If Not IsEmpty(cell.Value) Then
'If the cell is NOT empy, I should add a checkbox, to the right of the cell without text
Set chkbox = ActiveSheet.CheckBoxes.Add(cell.Left, cell.Top, cell.Width, cell.Height)
With chkbox
.Text = ""
End With
Else
For Each chkbox In ActiveSheet.CheckBoxes
If Not Intersect(cell, chkbox.TopLeftCell) Is Nothing Then
chkbox.Delete
End If
Next chkbox
End If
Next cell
End If
Call LinkCheckBoxes
End Sub