AW: @ransi u.Volker..
24.05.2011 19:30:31
VolkerM
Hi,
so?
Private Sub UserForm_Activate()
On Error Resume Next
Dim arr() As Variant
Dim iRowL As Integer, iRow As Integer, iRowU As Integer
ListBox1.Clear
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 2 To iRowL
If Cells(iRow, 1).Value = "X" Then
If Not Left(Cells(iRow, 2), 1) "-" And Left(Cells(iRow + 1, 2), 1) = "-" Or _
Not Left(Cells(iRow + 1, 2), 1) = "-" And Left(Cells(iRow, 2), 1) "-" Then
If Not Cells(iRow, 2).Value = Left(Cells(iRow + 1, 2), -1) Then
If Not Cells(iRow, 2).Value = Left(Cells(iRow - 1, 2), -1) Then
ReDim Preserve arr(0 To 1, 0 To iRowU)
arr(0, iRowU) = Cells(iRow, 1)
arr(1, iRowU) = Cells(iRow, 2)
iRowU = iRowU + 1
End If
End If
End If
End If
Next iRow
ListBox1.Column = arr
End Sub
Gruß Volker