AW: Daten suchen - aber untereinander z.B. 3 Zeilen
10.12.2012 13:19:47
Mäxl
Hi
Option Explicit
Sub til()
Dim rngSuchsp As Range, objF As Object, StrFirstmatch As String
Set rngSuchsp = Columns(1) 'Spalte A, Spalte D wäre dann 4
Dim ArrSuch(2) 'deine Suchbegriffe
ArrSuch(0) = 10
ArrSuch(1) = 20
ArrSuch(2) = 30
Set objF = rngSuchsp.Find(ArrSuch(0), lookat:=xlWhole)
If Not objF Is Nothing Then
StrFirstmatch = objF.Address
Do
If objF.Offset(1, 0) = ArrSuch(1) And objF.Offset(2, 0) = ArrSuch(2) Then
'kopiere diese Zeilen in das zweite Blatt
Range(objF, objF.Offset(2, 0)).EntireRow.Copy Sheets(2).Cells(Rows.Count, 1).End( _
xlUp).Offset(1, 0)
End If
Set objF = rngSuchsp.FindNext(objF)
Loop While Not objF Is Nothing And objF.Address StrFirstmatch
End If
End Sub