- Katılım
- 12 Ocak 2009
- Mesajlar
- 838
- Excel Vers. ve Dili
- 2003
- Altın Üyelik Bitiş Tarihi
- 07-02-2024
Merhaba arkadaşlar.
Yeni kayıt makrom şu şekilde.
Kod yeni kayıt olayında otomatik sıra numarası veriyor ve tarih sıralamasına göre sıralama yapıyor. Ancak sayfaya baktığım zaman sıralamanın doğru olmadığını görüyorum.
Sayfada yerleşik fonksiyonlar ile de sıralama yapınca aynı hatanın devam ettiğini görüyorum. Sorun nerede anlamadım.


Yeni kayıt makrom şu şekilde.
Kod:
Private Sub cmdKAYDET_Click()
Sheets(ComboBox5.Text).Select
On Error Resume Next
If Not FrameTest Then Exit Sub
Dim Say As Long, son As Long, Satır As Long
Dim sor
If OptionButton3.Value = True Then 'Yeni Kayıt
If TextBox1.Text = "" Then
TextBox1.SetFocus
MsgBox ("Lütfen İşlem Tarihini Giriniz..."), vbInformation, "..."
Exit Sub
End If
If TextBox3.Value = True Then
If TextBox4.Text = "" Then
TextBox4.SetFocus
MsgBox ("Lütfen Ödenen Taksit Sayısını Giriniz..."), vbInformation, "..."
Exit Sub
End If
End If
son = Cells(Rows.Count, "b").End(xlUp).Row + 1
TextBox7.Value = son - 1
Cells(son, "B").Value = TextBox1.Value 'tarih
Cells(son, "B").HorizontalAlignment = xlCenter
Cells(son, "B").NumberFormat = "mm.dd.yyyy"
Cells(son, "C").Value = ComboBox1.Value 'kategori
Cells(son, "C").HorizontalAlignment = xlLeft
Cells(son, "D").Value = ComboBox2.Value 'alt kategori
Cells(son, "D").HorizontalAlignment = xlLeft
Cells(son, "E").Value = ComboBox3.Value 'harcama türü
Cells(son, "E").HorizontalAlignment = xlLeft
Cells(son, "F").Value = ComboBox4.Value 'harcama kalemi
Cells(son, "F").HorizontalAlignment = xlLeft
Cells(son, "G").Value = CCur(TextBox8.Value) 'taksit tutarı
Cells(son, "G").HorizontalAlignment = xlRight
Cells(son, "H").Value = TextBox3.Value 'taksit sayısı
Cells(son, "H").HorizontalAlignment = xlCenter
Cells(son, "I").Value = TextBox4.Value 'ödenen taksit
Cells(son, "I").HorizontalAlignment = xlCenter
Cells(son, "J").Value = TextBox5.Value 'kalan taksit
Cells(son, "J").HorizontalAlignment = xlCenter
Cells(son, "K").Value = CCur(TextBox6.Value) 'kalan tutar
Cells(son, "K").HorizontalAlignment = xlRight
MsgBox "" & TextBox1.Value & " Tarihli " & ComboBox2.Value & " Giderine Ait Yeni Kayıt Başarıyla Yapılmıştır. İyi Çalışmalar Dilerim", vbInformation, "Sn. " & Application.username
cmdTEMİZLE_Click
'-------Sıra Numarası ver ve Tarihe Göre Sırala---------------------
Range("b2:b" & [b65536].End(3).Row).Value = Range("b2:b" & [b65536].End(3).Row).Value
Range("A2:K" & [b65536].End(3).Row).Sort Range("b2"), xlAscending
Satır = Range("b65536").End(3).Row
If Satır = 2 Then
Cells(2, 1) = 1
ElseIf Satır > 2 Then
Cells(2, 1) = 1
Range("A2:A" & Satır).DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1
End If
MsgBox " Sıralandı ", vbInformation, "Sn. " & Application.username
'--------------------------------------------------------------------
Unload UserForm1
UserForm1.Show
TextBox7.Value = WorksheetFunction.Count(Range("A1:A65500")) + 1
End If
End Sub
Sayfada yerleşik fonksiyonlar ile de sıralama yapınca aynı hatanın devam ettiğini görüyorum. Sorun nerede anlamadım.

