Merhaba,
VBA' de yazmış olduğum bir checkbox kodunu kısaltmak istiyorum.
Toplam 130 adet checkbox var ve arttırılabilir de. Aşağıdaki kodu 1'den 130'a kadar olacak şekilde döngüye sokmaya çalışıyorum. Yardımcı olursanız sevinirim.
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then Range("g11").Value = Range("g10").Value * Range("b11").Value
If CheckBox1.Value = False Then Range("g11").Value = 0
If CheckBox1.Value = True Then CheckBox5.Value = "0"
If CheckBox1.Value = True Then CheckBox2.Value = "0"
If CheckBox1.Value = True Then CheckBox3.Value = "0"
If CheckBox1.Value = True Then CheckBox4.Value = "0"
Bir de bu checkboxların bir tuşla temizlenmesi için yazılmış kodlar var, bunu da kısaltmak istiyorum.
Private Sub CommandButton1_Click()
CheckBox1 = 0
CheckBox2 = 0
CheckBox3 = 0
.
.
.
.
CheckBox130 = 0
End sub
VBA' de yazmış olduğum bir checkbox kodunu kısaltmak istiyorum.
Toplam 130 adet checkbox var ve arttırılabilir de. Aşağıdaki kodu 1'den 130'a kadar olacak şekilde döngüye sokmaya çalışıyorum. Yardımcı olursanız sevinirim.
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then Range("g11").Value = Range("g10").Value * Range("b11").Value
If CheckBox1.Value = False Then Range("g11").Value = 0
If CheckBox1.Value = True Then CheckBox5.Value = "0"
If CheckBox1.Value = True Then CheckBox2.Value = "0"
If CheckBox1.Value = True Then CheckBox3.Value = "0"
If CheckBox1.Value = True Then CheckBox4.Value = "0"
Bir de bu checkboxların bir tuşla temizlenmesi için yazılmış kodlar var, bunu da kısaltmak istiyorum.
Private Sub CommandButton1_Click()
CheckBox1 = 0
CheckBox2 = 0
CheckBox3 = 0
.
.
.
.
CheckBox130 = 0
End sub