How to - decode unicode to ascii - needs an excel function

asafush

New Member
Joined
Nov 24, 2011
Messages
6
Hello,

I'm trying to figure out if there is any function in excel (2007) which helps
decoding unicode to ascii?

I have one column in my sheet which contains word/sentences in Spanish and I want to create a new column which will be contained with the unicode value of each word/sentences.

For Example,

País => " País "

How do I decode (unicode to ascii) the word 'País' in excel?

Thank's for helping...
 
HI

Try this udf:

Code:
Function GetUC(s As String) As String
Dim sResult As String
Dim j As Long
 
For j = 1 To Len(s)
    sResult = sResult & "/u" & Right("000" & Hex(AscW(Mid(s, j, 1))), 4)
Next j
GetUC = sResult
End Function
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Something like

Code:
Function Decode(dString As String)
Dim dLen As Long, dTemp As String
    For dLen = 1 To Len(dString)
        dTemp = dTemp & "& # " & Asc(Mid(dString, dLen, 1)) & ";"
    Next
Decode = dTemp
End Function

Would create the strings you asked for, but wouldn't eliminate any invalid character problems.
Hi jasonb75,

Your posted function was very useful for me.. saved me lots of time.

However, I'm trying to figure out the vice versa function, which takes the unicode values
and do the opposite action.

Any Idea?
Thanks'.
 
Upvote 0
Hi jasonb75,

Your posted function was very useful for me.. saved me lots of time.

However, I'm trying to figure out the vice versa function, which takes the unicode values
and do the opposite action.

Any Idea?
Thanks'.

You mean you want to take the string " & # 80;& # 97;& # 237;& # 115; " and return " País " ?
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,263
Members
448,881
Latest member
Faxgirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top