Spliting a String with no Delimiters
Ok so im new to this forum and have not been in the VBA game for long so hopefully in my inexperience I have just missed the obvious. What I am trying to do is split a string of numbers into three different columns. The problem arises because their is no delimiters in the string
an example of the string would be
T010203
and I need it split into three columns
T01 02 03
Any help would be greatly appreciated
Re: Spliting a String with no Delimiters
Welcome to the forums. :wave:
Presuming the string will always be the same length
vb Code:
Private Sub Command1_Click()
Dim strString As String
Dim strCol1 As String
Dim strCol2 As String
Dim strCol3 As String
strString = "T010203"
strCol1 = Left(strString, 3)
strCol2 = Mid(strString, 4, 2)
strCol3 = Right(strString, 2)
MsgBox strCol1 & " " & strCol2 & " " & strCol3
End Sub