Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88081

Macro to convert Special Characters to Alpha Numeric

$
0
0

I am writing a VB Script to convert Alpha Numerics to Special Characters and Vice-Versa. The script worked fine when I tried to convert Alpha Numeric values to Special Characters but it just returns 'X' when I try to convert Special Characters to Alpha Numeric. I am not sure why. I have pasted the code below. Any help is appreciated.

fnd = Array("~","\",">","!","@","#")
rplc = Array("A", "B", "C","1","2","3")
For x = LBound(fnd) To UBound(fnd)
    'Loop through each worksheet in ActiveWorkbook
    For Each sht In ActiveWorkbook.Worksheets
        sht.Cells.Replace What:=fnd(x), Replacement:=rplc(x), _
        LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, _
        SearchFormat:=False, ReplaceFormat:=False
    Next sht  
Next x

Viewing all articles
Browse latest Browse all 88081

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>