
WorkSheet("tuoFoglio").Range("TuaCella").Value = Label1.Caption
Dove Label1 è l'etichetta che è vicino alla CheckBox |
Private Sub CommandButton2_Click()
Dim nome As String
Dim chk As Control
nome = Cells(9, 2).Value
For Each chk In UserForm1.Controls
If TypeName(chk) = "CheckBox" Then
chk.Value = False
End If
Next chk
Select Case nome
Case Is = "Marco"
UserForm1.CheckBox1.Value = True
Case Is = "Giovanni"
UserForm1.CheckBox2.Value = True
Case Is = "Federico"
UserForm1.CheckBox3.Value = True
Case Is = "Francesco"
UserForm1.CheckBox4.Value = True
Case Is = "Moira"
UserForm1.CheckBox5.Value = True
Case Is = "Liliana"
UserForm1.CheckBox6.Value = True
Case Is = "Domenica"
UserForm1.CheckBox7.Value = True
Case Is = "Sofia"
UserForm1.CheckBox8.Value = True
End Select
End Sub
|
Private Sub CommandButton3_Click()
Dim cll As Range
Dim miorange As Range
Dim chk As Control
Set miorange = Range("B9:B15")
For Each chk In UserForm1.Controls
If TypeName(chk) = "CheckBox" Then
chk.Value = False
End If
Next chk
For Each cll In miorange
Select Case cll.Value
Case Is = "Marco"
UserForm1.CheckBox1.Value = True
Case Is = "Giovanni"
UserForm1.CheckBox2.Value = True
Case Is = "Federico"
UserForm1.CheckBox3.Value = True
Case Is = "Francesco"
UserForm1.CheckBox4.Value = True
Case Is = "Moira"
UserForm1.CheckBox5.Value = True
Case Is = "Liliana"
UserForm1.CheckBox6.Value = True
Case Is = "Domenica"
UserForm1.CheckBox7.Value = True
Case Is = "Sofia"
UserForm1.CheckBox8.Value = True
End Select
Next cll
End Sub
|
Private Sub CommandButton3_Click()
Dim ctl As Control
For Each ctl In UserForm1.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "CheckBox" Or TypeName(ctl) = "OptionButton" Then
ctl.Value = ""
End If
Next ctl
End Sub |
Private Sub CommandButton3_Click()
Dim ctl As Control
For Each ctl In UserForm1.Controls
If TypeName(ctl) = "TextBox" Then
ctl.Value = ""
End If
Next ctl
End Sub |
