AW: Aufruf
04.02.2006 08:45:49
Franz
Hallo mathias,
Du muss in einer Schleife Do...Loop oder For ...Next
die gefundenen Werte als String an die nächste Funktion übergeben.
Beispiel:
Sub Beispiel()
Dim Zelle As Range, Zellen As Range
Set Zellen = ThisWorkbook.Sheets("Tab1").Range("C1:C10")
For Each Zelle In Zellen
Zelle.Select
If extract(Zelle.Value, "A", "T") <> "" Then
Ergebnis = Links2(extract(Zelle.Value, "A", "T"))
MsgBox Ergebnis
End If
Next
End Sub
Function extract(strText As String, firstChar As String, lastChar As String) As String
Dim intS As Integer, intE As Integer
intS = InStr(1, strText, firstChar)
intE = InStr(1, strText, lastChar)
If intS = 0 Or intE = 0 Then Exit Function
extract = Mid(strText, intS + 1, intE - intS - 1)
End Function
Function Links2(Text As String)
Links2 = Left(Text, 2)
End Function
Gruß
Franz