Hello, people!
I have a problem with ActiveX checkboxes. I have a formulas on column G which sometimes return blank based on a criteria. I have ActiveX checkboxes next to each cell on the next column (H). I want those ActiveX checkboxes to be hidden then the formula in the adjacent cell on column G returns blank. The checkboxes are named cbWin1, cbWin2,... and so on. This is the code I've tried and it doesn't work:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim chkBox As OLEObject
Dim i As Integer, k As Integer
k = 50
For Each chkBox In ActiveSheet.OLEObjects
For i = 1 To k
If TypeName(chkBox.Object) = ("cbWin" & i) Then
If Range("G" & i) = "" Then
chkBox.Visible = False
Else: chkBox.Visible = True
End If
End If
Next i
Next
End Sub
Any ideas!
Thanks a lot!
Bookmarks