eparada
10-07-2014 19:36:57
Olá amigos!
Eu precisava criar um loop para executar uma função "If" para várias checkboxes, como no exemplo à seguir:
Private Sub CommandButton1_Click()
Dim atvd As Variant
If CheckBox1.Value = True Then
atvd = atvd + Me.CheckBox1.Caption
End If
If CheckBox2.Value = True Then
If atvd = "" Then
atvd = atvd + Me.CheckBox2.Caption
Else
atvd = atvd + ", " + Me.CheckBox2.Caption
End If
End If
If CheckBox3.Value = True Then
If atvd = "" Then
atvd = atvd + Me.CheckBox3.Caption
Else
atvd = atvd + ", " + Me.CheckBox3.Caption
End If
End If
.
.
.
O problema é que eu vou precisar executar essa função pra mais de uma centena checkboxes!!! Vocês podem me dar alguma ideia?!
Eu precisava criar um loop para executar uma função "If" para várias checkboxes, como no exemplo à seguir:
Private Sub CommandButton1_Click()
Dim atvd As Variant
If CheckBox1.Value = True Then
atvd = atvd + Me.CheckBox1.Caption
End If
If CheckBox2.Value = True Then
If atvd = "" Then
atvd = atvd + Me.CheckBox2.Caption
Else
atvd = atvd + ", " + Me.CheckBox2.Caption
End If
End If
If CheckBox3.Value = True Then
If atvd = "" Then
atvd = atvd + Me.CheckBox3.Caption
Else
atvd = atvd + ", " + Me.CheckBox3.Caption
End If
End If
.
.
.
O problema é que eu vou precisar executar essa função pra mais de uma centena checkboxes!!! Vocês podem me dar alguma ideia?!