Thread: [Solved] Checkbox in Userform
View Single Post
 
Old 02-18-2014, 03:26 AM
lukael lukael is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Feb 2014
Posts: 7
lukael is on a distinguished road
Default Checkbox in Userform

Hello, I want to make this code working on my Userform1, which has checkbox in It. Userform1 is activated with macro1(Userform1.Show) on worksheet (button). Code works great wih no Userfom :

Code:
Private Sub Worksheet_Change(ByVal Target As Range) 
    Dim blnValue As Boolean 
    Dim shpCB As Shape 
    If Target.Count = 1 Then 
        If Not Intersect(Target, Range("C4,C6")) Is Nothing Then 
            blnValue = WorksheetFunction.CountA(Range("C4,C6")) = 2 
            For Each shpCB In ActiveSheet.Shapes 
                If shpCB.Name Like "Check*" Then 
                    shpCB.ControlFormat.Value = blnValue * -1 
                End If 
            Next shpCB 
        End If 
    End If 
End Sub
Reply With Quote