PDA

View Full Version : replacing characters in a column which occu at random positions



ushasharma84
07-19-2011, 04:53 AM
hi

i have a column in which i want to replace certain special characters with some other characters. now the problem is these characters occurs at random position in string so position of characters is not fixed in that column. for example i want to raplace ± symbol in the cell which occurs at many cells in that column at random positiion with ±. because i m importing this excel to xml and in xml these symbols should be entered in other codes. so want some help to read the string character by character and replacing that character.i hope i made myself clear. waiting for reply...............

Thanks in advance

Bob Phillips
07-19-2011, 05:38 AM
Doesn't Find/Replace do it for you?

CatDaddy
07-19-2011, 09:57 AM
Replace (myString, stringToReplace, replacementString)

Replace("John*Patterson", "*", " ")
"John*Patterson" --> "John Patterson"

ushasharma84
07-20-2011, 03:36 AM
Thanks all

Again there is one problem . i want to replace F₂,T₂,π,α,β,δ and some other symbols with some other characters. now i am not able to paste the subscript text as well as these other characters in code window.how to do that???waiting for reply......


:bug:

Aussiebear
07-21-2011, 04:04 AM
Try attaching a sample workbook by, clicking on Go Advanced , scroll down until you find Manage Attachments and follow the directions. In the sample workbook list in one column, all of the symbols you are seeking to replace, and in the second column the symbol you are wanting replace them with.

shrivallabha
07-22-2011, 07:39 AM
Thanks all

Again there is one problem . i want to replace F₂,T₂,π,α,β,δ and some other symbols with some other characters. now i am not able to paste the subscript text as well as these other characters in code window.how to do that???waiting for reply......


:bug:

VBE Window won't be able to show these characters (doesn't support it). Check out "AscW" method or google for "greek alphabets in vba". However, you might be setting yourself on a wild goose chase. You'd be better of using what XLD suggested at #2.