Find > in a string

M

Mike

Im tring to replace > with ""
sUpcDescription = sUpcDescription.Replace(">", "")
But for some reason its not reconizing ">". Is there a char for this symbol.
 
J

Jeff

Try using the Instr & Chr Functions like this

If InStr(1, sUpcDescription, Chr(62), vbBinaryCompare) Then
sUpcDescription = Replace(sUpcDescription, Chr(62), "", 1, 1)
 
P

Peter T

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
 
Top