sirkülasyon
Altın Üye
- Katılım
- 10 Temmuz 2012
- Mesajlar
- 2,532
- Excel Vers. ve Dili
- 2021 LTSC TR
- Altın Üyelik Bitiş Tarihi
- 18-06-2026
Private Sub CommandButton1_Click() 'kaydet
Dim aranan As Range, bul As Long, son As Variant
Dim a() As Variant
Dim dizi As Variant
Application.ScreenUpdating = False
With Sheets("öğrenci")
son = .Range("d" & Rows.Count).End(3).Row + 1
Set aranan = .Range("d:d").Find(Me.TextBox21.Value, , , 1)
If Not aranan Is Nothing Then
If MsgBox("Aynı kayıt bulundu, yine de kaydedilsin mi?", vbYesNo, "Bilgi") = vbYes Then
.Range("a" & son).Value = ComboBox1.Value
.Range("c" & son).Value = ComboBox2.Value
.Range("c" & son).Value = ComboBox3.Value
.Range("d" & son).Value = TextBox21.Value
.Range("e" & son).Value = TextBox25.Value
.Range("f" & son).Value = ComboBox3.Value
.Range("g" & son).Value = TextBox1.Value
.Range("h" & son).Value = TextBox1.Value
.Range("ı" & son).Value = TextBox3.Value
.Range("j" & son).Value = TextBox4.Value
.Range("k" & son).Value = TextBox5.Value
.Range("l" & son).Value = TextBox6.Value
.Range("m" & son).Value = TextBox7.Value
.Range("n" & son).Value = TextBox8.Value
.Range("o" & son).Value = TextBox9.Value
.Range("p" & son).Value = TextBox10.Value
.Range("q" & son).Value = TextBox11.Value
.Range("r" & son).Value = TextBox12.Value
.Range("s" & son).Value = TextBox13.Value
.Range("t" & son).Value = TextBox14.Value
.Range("u" & son).Value = TextBox15.Value
.Range("v" & son).Value = TextBox16.Value
.Range("w" & son).Value = TextBox17.Value
.Range("x" & son).Value = TextBox18.Value
.Range("y" & son).Value = TextBox19.Value
.Range("z" & son).Value = TextBox20.Value
End If
Else
.Range("a" & son).Value = ComboBox1.Value
.Range("c" & son).Value = ComboBox2.Value
.Range("c" & son).Value = ComboBox3.Value
.Range("d" & son).Value = TextBox21.Value
.Range("e" & son).Value = TextBox25.Value
.Range("f" & son).Value = ComboBox3.Value
.Range("g" & son).Value = TextBox1.Value
.Range("h" & son).Value = TextBox1.Value
.Range("ı" & son).Value = TextBox3.Value
.Range("j" & son).Value = TextBox4.Value
.Range("k" & son).Value = TextBox5.Value
.Range("l" & son).Value = TextBox6.Value
.Range("m" & son).Value = TextBox7.Value
.Range("n" & son).Value = TextBox8.Value
.Range("o" & son).Value = TextBox9.Value
.Range("p" & son).Value = TextBox10.Value
.Range("q" & son).Value = TextBox11.Value
.Range("r" & son).Value = TextBox12.Value
.Range("s" & son).Value = TextBox13.Value
.Range("t" & son).Value = TextBox14.Value
.Range("u" & son).Value = TextBox15.Value
.Range("v" & son).Value = TextBox16.Value
.Range("w" & son).Value = TextBox17.Value
.Range("x" & son).Value = TextBox18.Value
.Range("y" & son).Value = TextBox19.Value
.Range("z" & son).Value = TextBox20.Value
End If
End With
TextBox1.Value = Empty
TextBox2.Value = Empty
TextBox3.Value = Empty
TextBox4.Value = Empty
TextBox5.Value = Empty
TextBox6.Value = Empty
TextBox7.Value = Empty
TextBox8.Value = Empty
TextBox9.Value = Empty
TextBox10.Value = Empty
TextBox11.Value = Empty
TextBox12.Value = Empty
TextBox13.Value = Empty
TextBox14.Value = Empty
TextBox15.Value = Empty
TextBox16.Value = Empty
TextBox17.Value = Empty
TextBox18.Value = Empty
TextBox19.Value = Empty
TextBox20.Value = Empty
Unload Me
End Sub
4. satırdan itibaren kayıt yapması için ne eklemeliyim koda?
Yardımcı olabilir misiniz?
Dim aranan As Range, bul As Long, son As Variant
Dim a() As Variant
Dim dizi As Variant
Application.ScreenUpdating = False
With Sheets("öğrenci")
son = .Range("d" & Rows.Count).End(3).Row + 1
Set aranan = .Range("d:d").Find(Me.TextBox21.Value, , , 1)
If Not aranan Is Nothing Then
If MsgBox("Aynı kayıt bulundu, yine de kaydedilsin mi?", vbYesNo, "Bilgi") = vbYes Then
.Range("a" & son).Value = ComboBox1.Value
.Range("c" & son).Value = ComboBox2.Value
.Range("c" & son).Value = ComboBox3.Value
.Range("d" & son).Value = TextBox21.Value
.Range("e" & son).Value = TextBox25.Value
.Range("f" & son).Value = ComboBox3.Value
.Range("g" & son).Value = TextBox1.Value
.Range("h" & son).Value = TextBox1.Value
.Range("ı" & son).Value = TextBox3.Value
.Range("j" & son).Value = TextBox4.Value
.Range("k" & son).Value = TextBox5.Value
.Range("l" & son).Value = TextBox6.Value
.Range("m" & son).Value = TextBox7.Value
.Range("n" & son).Value = TextBox8.Value
.Range("o" & son).Value = TextBox9.Value
.Range("p" & son).Value = TextBox10.Value
.Range("q" & son).Value = TextBox11.Value
.Range("r" & son).Value = TextBox12.Value
.Range("s" & son).Value = TextBox13.Value
.Range("t" & son).Value = TextBox14.Value
.Range("u" & son).Value = TextBox15.Value
.Range("v" & son).Value = TextBox16.Value
.Range("w" & son).Value = TextBox17.Value
.Range("x" & son).Value = TextBox18.Value
.Range("y" & son).Value = TextBox19.Value
.Range("z" & son).Value = TextBox20.Value
End If
Else
.Range("a" & son).Value = ComboBox1.Value
.Range("c" & son).Value = ComboBox2.Value
.Range("c" & son).Value = ComboBox3.Value
.Range("d" & son).Value = TextBox21.Value
.Range("e" & son).Value = TextBox25.Value
.Range("f" & son).Value = ComboBox3.Value
.Range("g" & son).Value = TextBox1.Value
.Range("h" & son).Value = TextBox1.Value
.Range("ı" & son).Value = TextBox3.Value
.Range("j" & son).Value = TextBox4.Value
.Range("k" & son).Value = TextBox5.Value
.Range("l" & son).Value = TextBox6.Value
.Range("m" & son).Value = TextBox7.Value
.Range("n" & son).Value = TextBox8.Value
.Range("o" & son).Value = TextBox9.Value
.Range("p" & son).Value = TextBox10.Value
.Range("q" & son).Value = TextBox11.Value
.Range("r" & son).Value = TextBox12.Value
.Range("s" & son).Value = TextBox13.Value
.Range("t" & son).Value = TextBox14.Value
.Range("u" & son).Value = TextBox15.Value
.Range("v" & son).Value = TextBox16.Value
.Range("w" & son).Value = TextBox17.Value
.Range("x" & son).Value = TextBox18.Value
.Range("y" & son).Value = TextBox19.Value
.Range("z" & son).Value = TextBox20.Value
End If
End With
TextBox1.Value = Empty
TextBox2.Value = Empty
TextBox3.Value = Empty
TextBox4.Value = Empty
TextBox5.Value = Empty
TextBox6.Value = Empty
TextBox7.Value = Empty
TextBox8.Value = Empty
TextBox9.Value = Empty
TextBox10.Value = Empty
TextBox11.Value = Empty
TextBox12.Value = Empty
TextBox13.Value = Empty
TextBox14.Value = Empty
TextBox15.Value = Empty
TextBox16.Value = Empty
TextBox17.Value = Empty
TextBox18.Value = Empty
TextBox19.Value = Empty
TextBox20.Value = Empty
Unload Me
End Sub
4. satırdan itibaren kayıt yapması için ne eklemeliyim koda?
Yardımcı olabilir misiniz?