wie kann ich das folgende Array nach der 2. Spalte sortieren?
Sub Abt_TB_Change()
Dim iArtCount%, iListboxRowNr%, arr() As Variant, iRow, iRowU, sSearch$
Application.ScreenUpdating = False
If Abt_TB = "" Then
LB_AbtArtikel.RowSource = "Artikel!A2:C" & iLastRow
Else
LB_AbtArtikel.RowSource = ""
With wksArtikel
iLastRow = IIf(IsEmpty(.Cells(Rows.Count, 2)), _
.Cells(Rows.Count, 2).End(xlUp).Row, Rows.Count)
'* hier wird nach dem Suchbegriff gesucht
Set ArtFound = .Range("B2:B" & iLastRow).Find(Abt_TB, _
.Cells(iLastRow, 2), , xlWhole, , xlNext)
If Not ArtFound Is Nothing Then
'* Schleife von gefundener Stelle bis zu letzten Zeile
sSearch = ArtFound
For iRow = 2 To iLastRow
If .Cells(iRow, 2) "" And .Cells(iRow, 2) = ArtFound Then
ReDim Preserve arr(0 To 1, 0 To iRowU)
arr(0, iRowU) = .Cells(iRow, 1)
arr(1, iRowU) = .Cells(iRow, 3)
iRowU = iRowU + 1
End If
Next iRow
LB_AbtArtikel.Column = arr
End If
End With
End If
weiter:
Set ArtFound = Nothing
Application.ScreenUpdating = True
End Sub
Vielen Dank im Voraus!Servus