if not zelle=suche
15.07.2015 07:40:48
Chris
ich möchte per VBA alle vorhandene Worksheets nach einem Begriff durchsuchen.
Das Läuft soweit.
Was ich nicht hinbekomme ist der Fall, wenn keine Übereinstimmung gefunden wurde. If not zelle = suche geht nicht... wo liegt der Fehler..
Dim suche As String
Dim z As Long
Dim Zelle As Range
Dim Blatt As Worksheet
suche = TextBox1.Value
If suche = "" Then Exit Sub
For Each Blatt In ActiveWorkbook.Worksheets
For Each Zelle In Blatt.UsedRange
If Zelle = suche Then
UserForm3.Label1.Caption = suche & Blatt.Name
If Not Zelle = suche Then
UserForm3.Label1.Caption = "nix"
End If
end if
Next Zelle
Next Blatt
Chris