AW: ListBox füllen
09.02.2014 14:50:16
Beni
Hallo Frank
Mit diesem Code wird nur die Zeile mit dem Monatsletzten eingefügt.
Die Daten werden gesammelt und als Paket eingefügt.
Die Spalten und Zeilen in der Listbox beginnen bei 0
Gruss Beni
Private Sub CommandButton1_Click()
Dim arrValues() As Variant
intRowU = 0
For d = 2 To Cells(Rows.Count, 1).End(xlUp).Row
datum = Cells(d, 1)
datum1 = Cells(d, 1) + 1
If Not Month(datum) = Month(datum1) Then
le = Cells(d, 1)
ReDim Preserve arrValues(0 To 7, 0 To intRowU)
arrValues(0, intRowU) = Cells(d, 23) ' Spalte W
arrValues(1, intRowU) = Cells(d, 24)
arrValues(2, intRowU) = Cells(d, 25)
arrValues(3, intRowU) = Cells(d, 26)
arrValues(4, intRowU) = Cells(d, 27)
arrValues(5, intRowU) = Cells(d, 28)
arrValues(6, intRowU) = Cells(d, 29)
intRowU = intRowU + 1
End If
Next d
ListBox1.Column = arrValues
End Sub