Sub
Adressen_nach_Stadt()
Dim
Suche
As
String
Dim
Letzte_Zeile
As
Long
Dim
Ergebnis
As
String
Dim
n
As
Long
Dim
AgS
As
String
Suche =
""
Sheets(
"Tabelle1"
).
Select
Suche = InputBox(
"Nach welcher Stadt suchen Sie"
)
Ergebnis =
"Ergebnis für: "
& Suche &
"..."
& vbCrLf & vbCrLf
If
Suche =
""
Then
MsgBox
"Sie haben nichts eingegeben!"
Exit
Sub
Else
Letzte_Zeile = Cells(Cells.Rows.Count, 1).
End
(xlUp).Row
If
Letzte_Zeile > 4
Then
For
n = 1
To
Letzte_Zeile
If
InStr(1, LCase(Cells(n, 1).Value), LCase(Suche)) > 0
Then
Ergebnis = Ergebnis & _
"EMail: "
& vbTab & Cells(n, 1).Value & vbTab & vbCrLf & _
"Fax: "
& vbTab & Cells(n, 2).Value & vbCrLf
End
If
Next
MsgBox Ergebnis
End
If
End
If
End
Sub