- Katılım
- 10 Nisan 2014
- Mesajlar
- 113
- Excel Vers. ve Dili
- 2013 ingilizce
- Altın Üyelik Bitiş Tarihi
- 08/11/2017
Arkadaşlar merhaba,
Verileri excel'e yazmak için userform kullanılıyorum. Ve bu form aşağıdaki kod ile çalışmakta. Yapmak istediğim "Ödemeler 2017" sayfasına verileri yazmadan bu sayfadaki filtrelerin hepsini kaldırması sonrasında son satıra yazması.Aksi taktirde Ödemeler 2017 sayfasında filtre olduğu zaman mevcut kayıtlı verilerin üzerine yazıyor. Bu kodu nasıl düzenleyebilirim yardımcı olursanız sevinirim.
Verileri excel'e yazmak için userform kullanılıyorum. Ve bu form aşağıdaki kod ile çalışmakta. Yapmak istediğim "Ödemeler 2017" sayfasına verileri yazmadan bu sayfadaki filtrelerin hepsini kaldırması sonrasında son satıra yazması.Aksi taktirde Ödemeler 2017 sayfasında filtre olduğu zaman mevcut kayıtlı verilerin üzerine yazıyor. Bu kodu nasıl düzenleyebilirim yardımcı olursanız sevinirim.
Kod:
Private Sub CommandButton1_Click()
If TextBox7.Value <> "" And TextBox2.Value <> "" And TextBox3 <> "" And TextBox4 <> "" And TextBox5 <> "" And TextBox6 <> "" And TextBox8 <> "" Then
Set s1 = Sheets("CH1-1 transfer")
Set s2 = Sheets("Ödemeler 2017")
b = ActiveCell.Row
s1.Cells(b, "C").Value = TextBox2.Value
s1.Cells(b, "F").Value = TextBox4.Value
s1.Cells(b, "H").Value = ComboBox3.Value
s1.Cells(b, "L").Value = CDbl(TextBox7.Value)
s1.Cells(b, "M").Value = TextBox8.Value
s1.Cells(b, "D").Value = "A+"
If s1.Cells(b, "k").Value - TextBox7.Value >= 0 And s1.Cells(b, "k").Value <> "" Then
s1.Cells(b, "k").Value = s1.Cells(b, "k").Value - TextBox7.Value
Else
s1.Cells(b, "k").Value = ""
End If
k = s2.Range("J65536").End(xlUp).Row
X = s2.Range("J65536").End(xlUp).Row + 1
'y = s2.Cells(k, 1).Value
s2.Cells(X, 1).Value = X + 1
s2.Cells(X, "B").Value = ComboBox2.Value
s2.Cells(X, "C").Value = ComboBox1.Value
s2.Cells(X, "D").Value = TextBox3.Value
s2.Cells(X, "E").Value = TextBox2.Value
s2.Cells(X, "F").Value = TextBox5.Value
s2.Cells(X, "G").Value = TextBox4.Value
s2.Cells(X, "H").Value = ComboBox3.Value
s2.Cells(X, "L").Value = CDbl(TextBox7.Value)
s2.Cells(X, "J").Value = TextBox8.Value
s2.Cells(X, "K").Value = TextBox6.Value
If MsgBox("ÖDEME TALEP FORMU OLUSTURMAK iSTERMiSiNiZ ?", vbYesNo, "UYARI!") = vbNo Then
If CloseMode = 0 Then
Cancel = True
End If
Unload UserForm1
Else
Application.ScreenUpdating = False
yol = ThisWorkbook.Path & "\" & "Ödeme Talebi.xlsx"
Workbooks.Open (yol)
Sheets("Sheet1").Select
Cells(14, "f") = TextBox3
Cells(14, "h") = TextBox2
Cells(12, "f") = TextBox4
Cells(15, "h") = TextBox8
Cells(20, "f") = TextBox5
Cells(23, "c") = TextBox7 * 1.18
Cells(15, "b") = ComboBox3
Application.ScreenUpdating = True
MsgBox "KAYIT TAMAMLANDI ÖDEME FORMU OLUSTURULDU", , "BiLGi"
If CloseMode = 0 Then
Cancel = True
End If
Unload UserForm1
End If
Else
MsgBox "BOS ALANLAR VAR !!", , "BiLGi"
End If
End Sub