jeudi 18 mars 2021

Vba to mark Check Box if specific cells contains specific imput

i need to create check box to be checked only if another specific cell contains specific input and unchecked if this input is not existing, noting that i tried below code

Private Sub Worksheet_Ca()

Dim DestS As Worksheet
Set DestS = ThisWorkbook.Worksheets("rest")

Dim DestSh As Range
Set DestSh = DestS.Range("B2")

If DestSh.Value = "Device" Then
DestS.CheckBoxes("Reset").Value = xlOn
Else
DestS.CheckBoxes("Reset").Value = xlOff
End If
End Sub

Also the check box i used is part of the forms toolbar not activeX and i changed the name of the check box to 'reset'

The error i got using debug is method of checkbox of object _worksheet failed




Aucun commentaire:

Enregistrer un commentaire