Dim nome As String
Dim lettura, miaVarForm2, teleruttore, out9, out10, out11, out12, out13, out14, out15, out16, out17, out18, out19, out20, out21, out22, out23, out24, in9, in10, in11, in12, in13, in14, in15, in16, in17, in18, in19, in20, in21, in22, in23, in24, out8, out7, out6, out5, out4, out3, out2, out1, in8, in7, in6, in5, in4, in3, in2, in1 As Double
Private Sub CheckBox36_Click()
If CheckBox36.Value = True Then
lettura = "InOut"
Else:
lettura = "OutIn"
End If
End Sub
Private Sub CheckBox38_Click()
If CheckBox38.Value = True Then
out14 = 2 ^ 10
Else: out14 = 0
End If
End Sub
Private Sub CheckBox39_Click()
If CheckBox39.Value = True Then
out13 = 2 ^ 10
Else: out13 = 0
End If
End Sub
Private Sub CheckBox40_Click()
If CheckBox40.Value = True Then
out15 = 2 ^ 10
Else: out15 = 0
End If
End Sub
Private Sub CheckBox41_Click()
If CheckBox41.Value = True Then
out16 = 2 ^ 10
Else: out16 = 0
End If
End Sub
Private Sub CheckBox42_Click()
If CheckBox42.Value = True Then
out9 = 2 ^ 9
Else: out9 = 0
End If
End Sub
Private Sub CheckBox43_Click()
If CheckBox43.Value = True Then
out10 = 2 ^ 10
MsgBox (out10)
Else: out10 = 0
End If
End Sub
Private Sub CheckBox44_Click()
If CheckBox44.Value = True Then
out11 = 2 ^ 11
Else: out11 = 0
End If
End Sub
Private Sub CheckBox45_Click()
If CheckBox45.Value = True Then
out12 = 2 ^ 12
Else: out12 = 0
End If
End Sub
Private Sub CommandButton1_Click() '// Rountine che assegna numero e valore e lo restituisce su una nuova riga
ultimariga = Cells(Rows.Count, "A").End(xlUp).Row
Cells(ultimariga + 1, 1).EntireRow.Insert
Worksheets("Configurazione Home").Cells(ultimariga + 1, 1).Value = TextBox1.Value
Worksheets("Configurazione Home").Cells(ultimariga + 1, 2).Value = out24 + out23 + out22 + out21 + out20 + out19 + out18 + out17 + out16 + out15 + out14 + out13 + out12 + out11 + out10 + out9 + out8 + out7 + out6 + out5 + out4 + out3 + out2 + out1
Worksheets("Configurazione Home").Cells(ultimariga + 1, 3).Value = in8 + in7 + in6 + in5 + in4 + in3 + in2 + in1
Worksheets("Configurazione Home").Cells(ultimariga + 1, 4).Value = teleruttore
Worksheets("Configurazione Home").Cells(ultimariga + 1, 50).Value = Cells(1, 100).Value
ActiveCell.EntireRow.Insert
Unload Me
End Sub
Private Sub TextBox2_Change()
TextBox2.Value = Cells(1, 100).Value
End Sub
Private Sub Label4_Click()
End Sub
Private Sub TextBox1_Change()
nome = TextBox1.Value
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
teleruttore = 1
Else: teleruttore = 0
End If
End Sub
Private Sub CheckBox10_Click()
If CheckBox10.Value = True Then
in1 = 1
Else: in1 = 0
End If
End Sub
Private Sub CheckBox11_Click()
If CheckBox11.Value = True Then
in6 = 32
Else: in6 = 0
End If
End Sub
Private Sub CheckBox12_Click()
If CheckBox12.Value = True Then
in5 = 16
Else: in5 = 0
End If
End Sub
Private Sub CheckBox13_Click()
If CheckBox13.Value = True Then
in7 = 64
Else: in7 = 0
End If
End Sub
Private Sub CheckBox14_Click()
If CheckBox14.Value = True Then
in8 = 128
Else: in8 = 0
End If
End Sub
Private Sub CheckBox15_Click()
If CheckBox15.Value = True Then
in2 = 2
Else: in2 = 0
End If
End Sub
Private Sub CheckBox16_Click()
If CheckBox16.Value = True Then
in3 = 4
Else: in3 = 0
End If
End Sub
Private Sub CheckBox17_Click()
If CheckBox17.Value = True Then
in4 = 8
Else: in4 = 0
End If
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
out6 = 32
Else: out6 = 0
End If
End Sub
Private Sub CheckBox3_Click()
If CheckBox3.Value = True Then
out5 = 16
Else: out5 = 0
End If
End Sub
Private Sub CheckBox4_Click()
If CheckBox4.Value = True Then
out7 = 64
Else: out7 = 0
End If
End Sub
Private Sub CheckBox5_Click()
If CheckBox5.Value = True Then
out8 = 128
Else: out8 = 0
End If
End Sub
Private Sub CheckBox6_Click()
If CheckBox6.Value = True Then
out1 = 1
Else: out1 = 0
End If
End Sub
Private Sub CheckBox7_Click()
If CheckBox7.Value = True Then
out2 = 2
Else: out2 = 0
End If
End Sub
Private Sub CheckBox8_Click()
If CheckBox8.Value = True Then
out3 = 4
Else: out3 = 0
End If
End Sub
Private Sub CheckBox9_Click()
If CheckBox9.Value = True Then
out4 = 8
Else: out4 = 0
End If
End Sub
|