• DİKKAT

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

Soru Listbox boyut değişme sorunu.

Katılım
12 Mart 2021
Mesajlar
26
Excel Vers. ve Dili
2016
Altın Üyelik Bitiş Tarihi
04-04-2022
Merhaba hocalarım Bir fatura takip programı yapıyorum yalnız tarih yada fatura no ile filtreleme yaptığımda listboxın boyutları değişiyor ilgili kodu ekliyorum teşekkür ederim.


Kod:
Private Sub CommandButton19_Click()
ListBox1.RowSource = Empty
With Sheets(ComboBox1.Text)
ListBox1.ColumnWidths = "53;53;53;53;53;53;53;53;53;53;53"
If TextBoxtarih <> Empty Then
    For i = 11 To .Range("a65536").End(3).Row
        Debug.Print .Cells(i, 1).Value, Cells(i, 2)
        If .Cells(i, 1).Value = CDate(TextBoxtarih.Value) Then
            If CStr(.Cells(i, 2).Value) = TextBox7.Value Then
                ListBox1.AddItem Format(.Cells(i, 1).Value, "dd.mm.yyyy")
                ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, 2)
                ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, 3)
                ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, 4)
                ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, 5)
                ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, 6)
                ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, 7)
                ListBox1.List(ListBox1.ListCount - 1, 7) = Cells(i, 8)
                ListBox1.List(ListBox1.ListCount - 1, 8) = Cells(i, 9)
                ListBox1.List(ListBox1.ListCount - 1, 9) = Cells(i, 10)
                ListBox1.ColumnCount = 11
         
            ElseIf TextBox7.Value = Empty Then
                ListBox1.AddItem Format(.Cells(i, 1).Value, "dd.mm.yyyy")
                ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, 2)
                ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, 3)
                ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, 4)
                ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, 5)
                ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, 6)
                ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, 7)
                ListBox1.List(ListBox1.ListCount - 1, 7) = Cells(i, 8)
                ListBox1.List(ListBox1.ListCount - 1, 8) = Cells(i, 9)
                ListBox1.List(ListBox1.ListCount - 1, 9) = Cells(i, 10)
                ListBox1.ColumnCount = 11
                End If
        End If
    Next i
Else
For i = 11 To .Range("a65536").End(3).Row
         If CStr(.Cells(i, 2).Value) = TextBox7.Value Then
             ListBox1.AddItem Format(.Cells(i, 1).Value, "dd.mm.yyyy")
             ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, 2)
             ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, 3)
             ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, 4)
             ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, 5)
             ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, 6)
             ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, 7)
             ListBox1.List(ListBox1.ListCount - 1, 7) = Cells(i, 8)
             ListBox1.List(ListBox1.ListCount - 1, 8) = Cells(i, 9)
             ListBox1.List(ListBox1.ListCount - 1, 9) = Cells(i, 10)
             ListBox1.ColumnCount = 11
       
         ElseIf TextBox7.Value = Empty Then
             ListBox1.AddItem Format(.Cells(i, 1).Value, "dd.mm.yyyy")
             ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, 2)
             ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, 3)
             ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, 4)
             ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, 5)
             ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, 6)
             ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, 7)
             ListBox1.List(ListBox1.ListCount - 1, 7) = Cells(i, 8)
             ListBox1.List(ListBox1.ListCount - 1, 8) = Cells(i, 9)
             ListBox1.List(ListBox1.ListCount - 1, 9) = Cells(i, 10)
             ListBox1.ColumnCount = 11
         End If
    Next i
End If
End With
i = Empty
End Sub
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
43,542
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Bu satırı döngü dışına almalısınız.

ListBox1.ColumnCount = 11


Boyut değişimi içinde aşağıdaki satırı deneyiniz.

ListBox1.IntegralHeight = False
 
Katılım
12 Mart 2021
Mesajlar
26
Excel Vers. ve Dili
2016
Altın Üyelik Bitiş Tarihi
04-04-2022
Bu satırı döngü dışına almalısınız.

ListBox1.ColumnCount = 11


Boyut değişimi içinde aşağıdaki satırı deneyiniz.

ListBox1.IntegralHeight = False
dosyayı ekledim hocam bir bakarmısınız ?
 
Üst