Removing character

L

Lotto

I know that many of this topic have been posted, but this is unique in
a way. The code below usually works to remove a character, but what
if the Char I want to remove is the ". I even tried to outline these
with single quotes, but can't make it work.

Public Function RemoveComma(FieldIn As String) As String
Dim intX As Integer
Dim intY As Integer
Dim NewString As String

intY = 1
intX = InStr(1, FieldIn, ",")

Do While intX <> 0
NewString = NewString & Mid(FieldIn, intY, intX - intY)
intY = intX + 1
intX = InStr(intY, FieldIn, ",")
Loop

NewString = NewString & Mid(FieldIn, intY, Len(FieldIn) - intY +
1)
RemoveComma = NewString
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top