Trim out Hyphen

A

Anthony

Both work really well. Thanks a million! Unfortunately, we
have parts that have multiple Hyphens:

Example:

PN:
-----------------
1-34-523-23

Is there a way to eliminate the Hyphens all together?

Desired outcome:

PN:
 
M

mt

Anthony said:
Both work really well. Thanks a million! Unfortunately, we
have parts that have multiple Hyphens:

Example:

PN:
-----------------
1-34-523-23

Is there a way to eliminate the Hyphens all together?

Desired outcome:

PN:
 
R

Ruskin Hardie

retPart = ""
For myLoop = 1 to Len(Trim(part_num))
If Mid(part_num, myLoop, 1) = "-" Then
retPart = retPart & " "
Else
retPart = retPart & Mid(part_num, myLoop, 1)
End If
Next myLoop
part_num = retPart
 

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