Merhabalar,
Aşağıda bulunan kodu nasıl kısalta biliriz. Normalde 140 tane Texbox eklemem gerekiyor.
Private Sub OptionButton1_Change()
If OptionButton1 = True Then
Sheets("Sayfa2").Range("D3").Value = TextBox1.Text
TextBox2.Text = Sheets("Sayfa1").Range("A19").Value
TextBox3.Text = Sheets("Sayfa1").Range("A21").Value
TextBox4.Text = Sheets("Sayfa1").Range("A23").Value
TextBox5.Text = Sheets("Sayfa1").Range("A25").Value
TextBox6.Text = Sheets("Sayfa1").Range("A27").Value
TextBox7.Text = Sheets("Sayfa1").Range("A29").Value
TextBox8.Text = Sheets("Sayfa1").Range("A31").Value
TextBox9.Text = Sheets("Sayfa1").Range("A33").Value
TextBox10.Text = Sheets("Sayfa1").Range("A35").Value
TextBox11.Text = Sheets("Sayfa1").Range("A37").Value
TextBox12.Text = Sheets("Sayfa1").Range("A39").Value
TextBox13.Text = Sheets("Sayfa1").Range("A41").Value
TextBox14.Text = Sheets("Sayfa1").Range("A43").Value
TextBox15.Text = Sheets("Sayfa1").Range("A45").Value
Else
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
End If
End Sub
Aşağıda bulunan kodu nasıl kısalta biliriz. Normalde 140 tane Texbox eklemem gerekiyor.
Private Sub OptionButton1_Change()
If OptionButton1 = True Then
Sheets("Sayfa2").Range("D3").Value = TextBox1.Text
TextBox2.Text = Sheets("Sayfa1").Range("A19").Value
TextBox3.Text = Sheets("Sayfa1").Range("A21").Value
TextBox4.Text = Sheets("Sayfa1").Range("A23").Value
TextBox5.Text = Sheets("Sayfa1").Range("A25").Value
TextBox6.Text = Sheets("Sayfa1").Range("A27").Value
TextBox7.Text = Sheets("Sayfa1").Range("A29").Value
TextBox8.Text = Sheets("Sayfa1").Range("A31").Value
TextBox9.Text = Sheets("Sayfa1").Range("A33").Value
TextBox10.Text = Sheets("Sayfa1").Range("A35").Value
TextBox11.Text = Sheets("Sayfa1").Range("A37").Value
TextBox12.Text = Sheets("Sayfa1").Range("A39").Value
TextBox13.Text = Sheets("Sayfa1").Range("A41").Value
TextBox14.Text = Sheets("Sayfa1").Range("A43").Value
TextBox15.Text = Sheets("Sayfa1").Range("A45").Value
Else
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
End If
End Sub
