Reputation: 97
I tried looking around for this particular problem, but couldn't find it.
I am trying to replace an assortment of characters in a string.
I tried looping through the characters using their character codes, but my code will ?randomly? delete the entire string instead of just the special characters. (basically I just want the letters and numbers from the string) EG. ABC-3.3%H14T-6 I would just want ABC33H14T6
What is strange about this (to me) is that my code will delete the string on a random character, it's not always chr(41) or whatever, it changes each time I run the code.. is it maybe a formatting issue?
For Char = 33 To 47
Sheets("Sheet1").Cells(FRow, 44).Replace What:=Chr(Char), Replacement:="", LookAt:=xlPart
Next Char
I would give you the bulk of my code, but it is work-sensitive.
Any advice would be appreciated!
Thanks guys.
Upvotes: 1
Views: 726