• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Şartlı satır numarası

Katılım
26 Eylül 2020
Mesajlar
171
Excel Vers. ve Dili
excel 2019 pro.Türkçe
Aşağıdaki kod ile excel sayfasına kayıt yapılıyor.Ancak yeni girişlerde vermesi gereken satır numarasını vermiyor.( 6.satır) Daha farklı bir düzenleme yaparsanız sevinirim.Teşekkürler.

mutlu = Sheets("Anasayfa").Range("A10000").End(3).Row + 1
Sheets("Anasayfa").Cells(mutlu, "A") = TextBox3.Value
If Sheets("Anasayfa").Cells(mutlu, "A") = ComboBox4.Text Then
Sheets("Anasayfa").Cells(mutlu, "B") = Application.WorksheetFunction.VLookup(ComboBox4, Sheets("Anasayfa").Range("A15:N50000"), 2, 0)
Else
Sheets("Anasayfa").Cells(mutlu, "B").FormulaR1C1 = "=Row()"
End If
Sheets("Anasayfa").Cells(mutlu, "C") = TextBox4.Value
Sheets("Anasayfa").Cells(mutlu, "D") = TextBox5.Value
Sheets("Anasayfa").Cells(mutlu, "E") = TextBox6.Value & vbCrLf & vbCrLf
Sheets("Anasayfa").Cells(mutlu, "F") = TextBox7.Value
Sheets("Anasayfa").Cells(mutlu, "G") = TextBox11.Value
Sheets("Anasayfa").Cells(mutlu, "H") = TextBox9.Value
Sheets("Anasayfa").Cells(mutlu, "I") = TextBox10.Value
Sheets("Anasayfa").Cells(mutlu, "J") = ComboBox2.Value
Sheets("Anasayfa").Cells(mutlu, "K") = ComboBox3.Value
MsgBox "KAYIT YAPILMIŞTIR"
 
Merhaba;

Sheets("Anasayfa").Cells(mutlu, "B").FormulaR1C1 = "=Row()"
satırını;
Sheets("Anasayfa").Cells(mutlu, "B")=mutlu-1
şeklinde düzenleyerek deneyin.
İyi çalışmalar.
 
Yardımlarınızla kodu yeniden düzenledim.Çalışan kodu aşağıda paylaşıyorum.

Dim mutlu As Long
mutlu = Sheets("Anasayfa").Cells(Rows.Count, "A").End(3).Row + 1
Sheets("Anasayfa").Cells(mutlu, "A") = TextBox3.Value
Sheets("Anasayfa").Cells(mutlu, "C") = TextBox4.Value
Sheets("Anasayfa").Cells(mutlu, "D") = TextBox5.Value
Sheets("Anasayfa").Cells(mutlu, "E") = TextBox6.Value & vbCrLf & vbCrLf
Sheets("Anasayfa").Cells(mutlu, "F") = TextBox7.Value
Sheets("Anasayfa").Cells(mutlu, "G") = TextBox11.Value
Sheets("Anasayfa").Cells(mutlu, "H") = TextBox9.Value
Sheets("Anasayfa").Cells(mutlu, "I") = TextBox10.Value
Sheets("Anasayfa").Cells(mutlu, "J") = ComboBox2.Value
Sheets("Anasayfa").Cells(mutlu, "K") = ComboBox3.Value
If Sheets("Anasayfa").Cells(mutlu, "A") = ComboBox4.Text Then GoTo atla
Sheets("Anasayfa").Cells(mutlu, "B") = mutlu - 1
Exit Sub
atla:
Sheets("Anasayfa").Cells(mutlu, "B") = mutlu - 1
Sheets("Anasayfa").Cells(mutlu, "B") = Application.WorksheetFunction.VLookup(ComboBox4, Sheets("Anasayfa").Range("A15:N50000"), 2, 0)
MsgBox "KAYIT YAPILMIŞTIR"
 
Geri
Üst