Null Wert in ListBox
05.02.2023 11:40:43
Antonio
Ich fülle hiermit eine ListBox:
For lng = 24 To wks1.Cells(rows.Count, 2).End(xlUp).row 'ab Zeile 2
If Sheets("Neuer_Song").Cells(lng, 2) > "" Then
ListBox7.AddItem
ListBox7.List(ListBox7.ListCount - 1, 0) = wks1.Cells(lng, 2).Value
ListBox2.AddItem
If wks1.Cells(lng, 13) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 0) = wks1.Cells(lng, 13).Value
If wks1.Cells(lng, 14) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 1) = wks1.Cells(lng, 14).Value
If wks1.Cells(lng, 15) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 2) = wks1.Cells(lng, 15).Value
If wks1.Cells(lng, 16) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 3) = wks1.Cells(lng, 16).Value
If wks1.Cells(lng, 17) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 4) = wks1.Cells(lng, 17).Value
If wks1.Cells(lng, 18) = 0 Then ListBox2.List(ListBox2.ListCount - 1, 5) = wks1.Cells(lng, 18).Value
Aus dem Forum habe wenig gefunden, bis auf If wks1.Cells(lng, 13) = 0Ich habe damit nur erreicht das wenn bei den Null
>0 oder =0 oder>=0
das etwas im ListBox verschwindet
aber die Null sind immer noch da.
Kann mir jemand helfen den Code zu verbessern das es funzt?
Vielen Dank im Voraus
LG Antonio
Anzeige