AW: Damit's sicher nicht...
21.11.2007 10:30:21
Renee
ins Nirwana geht.
Wie Andi erwähnt hat, bei aktiver Zelle in Spalte A ....bumm
Sub KlarGehtDas()
Dim tSuchText As String
Dim vGefunden
Const tSuchBlatt = "Tabelle2"
Const tSuchBereich = "A1:G22"
If ActiveCell.Column = 1 Then
MsgBox "Leider hat es links von mir (" & _
ActiveCell.Address(0, 0) & ") KEINEN Platz"
Exit Sub
End If
try_again:
tSuchText = InputBox("Suchbegriff eingeben:" & vbCrLf & _
"(Leer oder Abbrechen zum Beenden)", _
"Suchen in " & tSuchBlatt, _
"Hier den Suchbegriff bitte..")
If tSuchText = "" Then Exit Sub
With ActiveWorkbook.Sheets(tSuchBlatt).Range(tSuchBereich)
Set vGefunden = .Find(tSuchText, LookIn:=xlValues)
If Not (vGefunden Is Nothing) Then
ActiveCell.Offset(0, -1).Value = vGefunden.Offset(0, 1).Value
Else
MsgBox "Sorry nix gefunden!"
GoTo try_again
End If
End With
End Sub
GreetZ Renee