Sub suche()
cb = InputBox("Bitte suchbegriff eingeben")
With Worksheets(1).Cells
Set c = .Find(cb, LookIn:=xlValues)
If Not c Is Nothing Then
' Beispiel
If c = "Etwas" Then
MsgBox "Hallo Welt"
End If
Else
MsgBox ("nicht gefunden")
End If
End With
End Sub
Sub suche()
cb = InputBox("Bitte suchbegriff eingeben")
With Worksheets(1).Cells
Set c = .Find(cb, LookIn:=xlValues)
If Not c Is Nothing Then
.Range("A1") = .Cells(1, c.Column)
Else
MsgBox ("nicht gefunden")
End If
End With
End Sub
Sub suche()
Dim cb As String
Dim c As Range
cb = InputBox("Bitte suchbegriff eingeben")
With Worksheets(1)
Set c = .Cells.Find(cb, LookIn:=xlValues)
If Not c Is Nothing Then
.Range("A1") = .Cells(1, c.Column)
Else
MsgBox ("nicht gefunden")
End If
End With
End Sub