Hello,
I'm trying to set-up a machine checklist.
But as this machine has a load of options on, I'd like to have the options selectable.
Problem with this is, some options go together and others change when they're selected together.
Code:
Private Sub CheckBox1_Click()
Sheets("Weight cells").Visible = CheckBox1.Value
End Sub
Private Sub CheckBox2_Click()
Sheets("Cooling system").Visible = CheckBox2.Value
If CheckBox2.Value = True Then
CheckBox5.Value = True
CheckBox5.Enabled = True
Else
CheckBox5.Enabled = True
End If
If CheckBox2.Value = True Then
CheckBox7.Value = True
CheckBox7.Enabled = True
Else
CheckBox7.Enabled = True
End If
End Sub
Private Sub CheckBox3_Click()
Sheets("Steam injection").Visible = CheckBox3.Value
If CheckBox3.Value = True Then
CheckBox5.Value = True
CheckBox5.Enabled = True
Else
CheckBox5.Enabled = True
End If
If CheckBox3.Value = True Then
CheckBox1.Value = True
CheckBox1.Enabled = True
Else
CheckBox1.Enabled = True
End If
End Sub
Private Sub CheckBox4_Click()
Sheets("Dosing unit").Visible = CheckBox4.Value
End Sub
Private Sub CheckBox5_Click()
Sheets("Temperature sensor").Visible = CheckBox5.Value
End Sub
Private Sub CheckBox6_Click()
Sheets("Exhaust valve vacuum").Visible = CheckBox6.Value
End Sub
Private Sub Checkbox7_Click()
Sheets("Exhaust tube").Visible = CheckBox7.Value
End Sub
Private Sub Checkbox8_Click()
Sheets("Exhaust tube cooling+vacuum").Visible = CheckBox8.Value
End Sub
Private Sub Checkbox9_Click()
Sheets("Vacuum unit").Visible = CheckBox9.Value
If CheckBox9.Value = True Then
CheckBox6.Value = True
CheckBox6.Enabled = True
Else
CheckBox6.Enabled = True
End If
End Sub
Private Sub Checkbox10_Click()
Sheets("Hinged Lid").Visible = CheckBox10.Value
If CheckBox10.Value = True Then
CheckBox11.Value = False
CheckBox11.Enabled = False
Else
CheckBox11.Enabled = True
End If
End Sub
Private Sub Checkbox11_Click()
Sheets("Sliding Lid").Visible = CheckBox11.Value
If CheckBox11.Value = True Then
CheckBox10.Value = False
CheckBox10.Enabled = False
Else
CheckBox10.Enabled = True
End If
End Sub
Private Sub Checkbox12_Click()
Dim i As Integer
For i = 1 To 10
ActiveSheet.OLEObjects(CheckBox & i).Object.Value = True
Next i
End Sub
Private Sub Checkbox13_Click()
Dim i As Integer
For i = 1 To 12
ActiveSheet.OLEObjects(CheckBox & i).Object.Value = False
Next i
End Sub
Weight cells- standalone
Cooling system- Temperature sensor- exhaust tube cooling- Hinged lid or sliding lid
Steam injection- temperature sensor- weight cells- hinged lid or sliding lid
Dosing unit- standalone
Vacuum unit- Exhaust valve vacuum- hinged lid or sliding lid
As for the above, that wasn't much of an issue.
These seem to be working, you can't select hinged lid and sliding lid at the same time.
The hard part (atleast, for me) starts when i'd like to combine Vacuum with the steam injection and cooling system.
This configuration would look something like this:
Vacuum unit- Steam injection- Cooling system- Exhaust tube cooling+vacuum- Hinged lid or sliding lid
Problem is, when i have "cooling system" selected with the "exhaust tube cooling" in the code I can't deselect the exhaust tube and select the "exhaust tube cooling+vacuum" instead, Same goes for the "Vacuum unit" and the "exhaust valve vacuum"
As a last question or sidenote, my "Select all" and Deselect all" buttons do not seem to be working at the moment.
Quote:
Runtime error '1004': Unable to get the OLEObjects property of the worksheet class
Thank you for taking the time in reading this and hopefully help me out!
Rick