• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

UserForm check boxes

Matt_Straya

Member
Hi, I have a training sheet I am trying to build, please forgive the untidiness of it. one problem I am having is that in cell C4 I have a conditional format to display checks, crosses etc using 0, 1, -2, -3 and -4. This works ok but when I open it in a form, the same check box is checked for each value. For example, if C4 has a value of 0 the check box named "Completed" is checked but it should only be checked if "1" (a green check icon) is the cells value. Similarly, the check box "Not Completed" in the userform should be checked if "0" is the value in C4.

To view the problem, right click in C1 and choose User Input at the bottom of the right click menu.

Just to reiterate, this is a work in progress. I would appreciate any ideas on how to fix this issue - the answer is probably right in front of me but I cant see the Forrest for the trees!
 

Attachments

  • Training_Problem.xlsm
    202.9 KB · Views: 5
Hi ,

There seem to be a few things wrong here :

What exactly do you want the following code to do ?
Code:
Private Sub Worksheet_Calculate()
        If Range("C4").value = 1 Then
           MultiPage1.Pages(0).CheckBox1.value = xlOn
        Else
           MultiPage1.Pages(0).CheckBox1.value = xlOff
           If Range("C4").value = -2 Then
              MultiPage1.Pages(0).CheckBox1.value = xlOn
           Else
              MultiPage1.Pages(0).CheckBox1.value = xlOff
              If Range("C4").value = -3 Then
                 MultiPage1.Pages(0).CheckBox1.value = xlOn
              Else
                 MultiPage1.Pages(0).CheckBox1.value = xlOff
                 If Range("C4").value = -4 Then
                    MultiPage1.Pages(0).CheckBox1.value = xlOn
                 Else
                    MultiPage1.Pages(0).CheckBox1.value = xlOff
                 End If
              End If
           End If
        End If
End Sub
Narayan
 
OH! I can see the mistake already! It references CheckBox1 for all instead of the other checkbox names. I was trying to get the checkboxs to populate with that coade.
 
No hold it - thats not right either the cell may have several different values and the checkboxes need to reflect that value
 
Back
Top