Office - Word, Excel und Co. 9.718 Themen, 41.069 Beiträge

Nun nochmal Olafs Zeichenkettenproblem.

peterson / 12 Antworten / Flachansicht Nickles

Kopiere dieses Makro mal in Dein Excel rein und führe es aus.

Das Ergebnis bekommst Du dann für die einfachere Erklärung in Message-Boxen.

Ich denke mal, das kannst Du leicht an Dein Problem anpassen.

********************************************************************
Public Sub Olaf()

Dim strText As String
Dim Start As Integer
Dim Mitte As Integer
Dim Ende As Integer

strText = "180:100:10:25"

Start = InStr(1, strText, ":")
Mitte = InStr(Start + 1, strText, ":")
Ende = InStr(Mitte + 1, strText, ":")

MsgBox "Vorne = " & Mid(strText, 1, Start - 1)
MsgBox "Teil1 = " & Mid(strText, Start + 1, Mitte - (Start + 1))
MsgBox "Teil2 = " & Mid(strText, Mitte + 1, Ende - (Mitte + 1))
MsgBox "Teil3 = " & Mid(strText, Ende + 1, Len(strText) - Ende)

End Sub

bei Antwort benachrichtigen