just use mid. example is from something I had to write. But I was ignoring the " ' ", but instead of that name it spc = " ". So my code was like this:
Public Function serialNumdel(serialNum) As String
Dim x As Integer
Dim apo As String
Dim tempserialnum As String
apo = "'"
For x = 1 To Len(serialNum)
If Mid(serialNum, x, 1) = apo Then
tempserialnum = Mid(serialNum, 1, x - 1)
serialNum = tempserialnum & Mid(serialNum, x + 1, Len _
(serialNum) - 1)
x = x - 1
End If
Next
End Function
notice, serialnumber would be your text string, tempserialnumber would be just a temporary holder while we parsed through it and removed what was needed. Where you see this:
apo = "'"
change it to
spc = " "
of course, you'll need to change the declarations to
dim spc as string
instead of
dim apo as string
__________________ If you argue with an idiot he will drag you down to his level and beat you with experience.
I am not a fast writer.
I am not a slow writer.
I am a half-fast writer. -Robert Asprin |