Hallo Mick,
Code in ein Modul einfügen.
Gesucht wird der Begriff in allen Tabellen, außer der Tabelle "Drucken" die Du noch anlegen musst.
Es werden dann die ganzen Zeilen die den Suchbegriff enthalten in die Tabelle "Drucken" übertragen.
Gruß
fedjo
Option Explicit
Global SSearch As String
Sub Suchen()
Dim ws As Worksheet
Dim c
Dim firstAddress As String
Dim secAddress
Dim GFound As Boolean
Dim GWeiter As Boolean
GWeiter = False
GFound = False
anf:
SSearch = InputBox("Bitte Namen eingeben!")
If SSearch = "" Then
End
End If
weiter:
For Each ws In Worksheets
If ws.Name = "Drucken" Then Exit Sub
With ws.Cells
Set c = .Find(SSearch, LookIn:=xlValues, MatchCase:=False)
If Not c Is Nothing Then
GFound = True
c.EntireRow.Copy Sheets("Drucken").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
firstAddress = c.Address
Do
Set c = .FindNext(c)
secAddress = c.Address
If c.Address = firstAddress Then
Exit Do
End If
c.EntireRow.Copy Sheets("Drucken").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
GWeiter = True
GoTo ende
Loop While Not c Is Nothing And secAddress <> firstAddress And c.Address <> firstAddress
Else
GWeiter = True
GoTo ende
End If
End With
Next ws
ende:
If GFound = False Then
If MsgBox("Suchwert nicht gefunden ! Neue Suche ?", vbInformation + vbYesNo) = vbYes Then
GoTo anf:
End If
End If
End Sub