Hello,
I have some code that changes the type of text string below
GV123456, 12345, H123456, 12, 12
to
123456 12345 123456 12 12
ie, removed letters, punctuation etc
Now the problem is, I only want to keep the 6 digit string & delete the rest, so out of the second string I will keep
123456 & 123456
Is this possible, I'm sure it is!!
Code
Private Sub Command6_Click()
Dim strOut As String
Dim i As Integer
Dim sLen As Integer
Dim StrPoint As Integer
i = Len(Me.Text2)
Me.Text9 = i
StrPoint = 1
For sLen = 1 To i
If IsNumeric(Mid(Me.Text2, sLen, 1)) Then
Me.Text7 = Me.Text7 & Mid(Me.Text2, sLen, 1)
Else: Me.Text7 = Me.Text7 & " "
End If
Next sLen
End Sub
Thanks
Geoff
I have some code that changes the type of text string below
GV123456, 12345, H123456, 12, 12
to
123456 12345 123456 12 12
ie, removed letters, punctuation etc
Now the problem is, I only want to keep the 6 digit string & delete the rest, so out of the second string I will keep
123456 & 123456
Is this possible, I'm sure it is!!
Code
Private Sub Command6_Click()
Dim strOut As String
Dim i As Integer
Dim sLen As Integer
Dim StrPoint As Integer
i = Len(Me.Text2)
Me.Text9 = i
StrPoint = 1
For sLen = 1 To i
If IsNumeric(Mid(Me.Text2, sLen, 1)) Then
Me.Text7 = Me.Text7 & Mid(Me.Text2, sLen, 1)
Else: Me.Text7 = Me.Text7 & " "
End If
Next sLen
End Sub
Thanks
Geoff