Hello,
I have the following code, and I'm having difficulty replacing those that I've assigned in red color.
May I know what's is wrong with the code.
As you can see....if it's a single such as "." , " " , "(" etc, it actually removed. Problem starts when I tried to remove anything that's 000HYR* or HYR* etc.
Sub NumberId_TextId()
Dim strSearch() As String, strSearchInt As Integer, valString As String
strSearch = Split(" ;/;\;(;);-;_;" & _
"000ABGT*;ABGT*;000ALNT*;ALNT*;000NBWK*;NBWK*;000TLBC*;TLBC*" & _
"000HYR*;HYR*;000BL*;BL*;000SKWN*;SKWN*;000TCOM*;TCOM*;000MSYS*;MSYS*;000NRWT*;NRWT*", ";")
For x = 1 To 12
valString = Trim(Range("A" & x))
For strSearchInt = LBound(strSearch) To UBound(strSearch)
valString = Replace(valString, strSearch(strSearchInt), "")
Next strSearchInt
Range("B" & x) = "'" & valString
Next x
End Sub
Bookmarks