Soru İki Tarih Aralığını Süzme

TURKOLOG

Altın Üye
Katılım
13 Kasım 2008
Mesajlar
744
Excel Vers. ve Dili
2016 64 TR
Altın Üyelik Bitiş Tarihi
29-10-2026
Herkese Merhaba
Kodda hata alıyorum
With Sayfa22 yani PASİF_İŞLEMLERİ sayfasında
Veriler
Textbox23 ilk tarih veriler G sütununda
Textbox24 ikinci tarih veriler H sütununda

Süz butonuna tıklayınca
Listbox1 e verileri getirmesini istiyorum.
Ama olmuyor

Kodu paylaşıyorum sizinle. Yardım edebilecek varsa çok sevinirim
Kod:
Private Sub Süz_Click()

  With Sayfa22

        Dim i As Long

For i = 2 To Range("a65536").End(3).Row

    If CLng(CDate(Cells(i, "G").Value)) >= CLng(CDate(TextBox23.Value)) And _

        CLng(CDate(Cells(i, "H").Value)) <= CLng(CDate(TextBox24.Value)) Then

         

        

          

    txtSira.Text = ListBox1.Column(0)

    txtSicili.Text = ListBox1.Column(1)

    txtAdi.Text = ListBox1.Column(2)

    txtSoyadi.Text = ListBox1.Column(3)

    txtRutbesi.Text = ListBox1.Column(4)

    txtBurosu.Text = ListBox1.Column(5)

    txtGidis.Text = ListBox1.Column(6)

    txtDonus.Text = ListBox1.Column(7)

    txtAciklama.Text = ListBox1.Column(8)

    TextBox8.Text = ListBox1.Column(9)

    TextBox9.Text = ListBox1.Column(10)

    TextBox10.Text = ListBox1.Column(11)

    TextBox11.Text = ListBox1.Column(12)

    TextBox12.Text = ListBox1.Column(13)

    TextBox13.Text = ListBox1.Column(14)

               

            

    End If

Next i

 

    

   End Sub
 

TURKOLOG

Altın Üye
Katılım
13 Kasım 2008
Mesajlar
744
Excel Vers. ve Dili
2016 64 TR
Altın Üyelik Bitiş Tarihi
29-10-2026
Kod:
Private Sub Süz_Click()

With Sayfa22

If TextBox23.Value = "" Or TextBox24.Value = "" Then

MsgBox "Lütfen Tarih seçiniz", vbCritical, "TARİH SEÇME HATASI"

Exit Sub

End If

Label1.Caption = TextBox23.Value

Label2.Caption = TextBox24.Value

Dim i As Long

ListBox1.Clear

For i = 2 To Range("a65536").End(3).Row

If CLng(CDate(Cells(i, "G").Value)) >= CLng(CDate(TextBox23.Value)) And CLng(CDate(Cells(i, "H").Value)) <= CLng(CDate(TextBox24.Value)) Then

With ListBox1

    .AddItem Format(Cells(i, 1).Value, "dd.mm.yyyy")

    .List(.ListCount - 1, 1) = Cells(i, 2).Value

    .List(.ListCount - 1, 2) = Cells(i, 3).Value

    .List(.ListCount - 1, 3) = Cells(i, 4).Value

    .List(.ListCount - 1, 4) = Cells(i, 5).Value

    .List(.ListCount - 1, 5) = Cells(i, 6).Value

    .List(.ListCount - 1, 6) = Cells(i, 7).Value

    .List(.ListCount - 1, 7) = Cells(i, 8).Value

    .List(.ListCount - 1, 9) = Cells(i, 10).Value

    .List(.ListCount - 1, 10) = Cells(i, 11).Value

    .List(.ListCount - 1, 11) = Cells(i, 12).Value

    .List(.ListCount - 1, 12) = Cells(i, 13).Value

    .List(.ListCount - 1, 13) = Cells(i, 14).Value

    .List(.ListCount - 1, 14) = Cells(i, 15).Value

   

    

     

    

    

   

    

End With

End If

Next i

i = Empty

 

    End With

   End Sub
Bu kodu denedim yine olmadı. Yardım edebilecek olan var mı
 
Üst