Private Sub ListBox1_Change()
Dim i As Integer, rng As Range, iRow As Integer
For iRow = 20 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(iRow, 1).Value = ListBox1.List(ListBox1.ListIndex) Then
If ListBox1.Selected(ListBox1.ListIndex) Then
If rng = Nothing Then
Set rng = Rows(iRow & ":" & iRow + 7)
Else
Set rng = Rows(rng.Rows & "," & iRow & ":" & iRow + 7)
End If
rng.Select
Else
Cells(iRow, 1).Select
End If
End If
Next iRow
End Sub
und würde gerne mal wissen, wieso er bei If rng = Nothing Then eine fehler bringt "unzulässige Verwenduing eines Objekts"
gruß louis