Find > in a string

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Im tring to replace > with ""
sUpcDescription = sUpcDescription.Replace(">", "")
But for some reason its not reconizing ">". Is there a char for this symbol.
 
Try using the Instr & Chr Functions like this

If InStr(1, sUpcDescription, Chr(62), vbBinaryCompare) Then
sUpcDescription = Replace(sUpcDescription, Chr(62), "", 1, 1)
 
Sub test()
Dim s1 As String, s2 As String
s1 = "A>B>C"
s2 = Replace(s1, ">", "")

MsgBox s1 & vbCr & s2
End Sub

Regards,
Peter T
 
Back
Top