Trim out Hyphen

  • Thread starter Thread starter Anthony
  • Start date Start date
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:
 
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:
 
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
 
Back
Top