+ Reply to Thread
Results 1 to 11 of 11

From Characters To Unicode

Hybrid View

  1. #1
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    From Characters To Unicode

    In Excel 2013, how do I translate all characters of selected cells to Unicode?
    There is a formula to translate the first character into Unicode [=UNICODE(text)]
    and that formula would have worked fine for me .Only if it could translate all the characters to Unicode not just the first one.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: From Characters To Unicode

    Can you post a sample workbook containing some representative text and the results you want to see (based on the sample)?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: From Characters To Unicode

    Hi,

    Welcome to the forum

    How do you intend to have the formula output the result for a word?
    Do you want the word broken up into 1 character per column/row and then the formula to evaluate each character?

    Please clarify your end result.
    TX
    Regards,
    Rudi

  4. #4
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: From Characters To Unicode

    Ok, The sample is in the attachment.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: From Characters To Unicode

    I want the characters to be in the column to the left and the Unicode to be in column on the right. Each individual unicode for a specific character has to be separated by a (-) symbol.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: From Characters To Unicode

    Function NS(sInp As String)
        Dim asChr() As String
        Dim iChr As Long
        
        ReDim asChr(1 To Len(sInp))
        For iChr = 1 To Len(sInp)
            asChr(iChr) = AscW(Mid(sInp, iChr, 1))
        Next iChr
        
        NS = Join(asChr, "-")
    End Function
    A
    B
    C
    1
    Input Output
    2
    e 101 B2: =NS(A2)
    3
    d 100
    4
    1
    49
    5
    - 45
    6
    ( 40
    7
    \ 92
    8
    ed1-(\ 101-100-49-45-40-92
    9
    d1- 100-49-45
    10
    \dee 92-100-101-101
    11
    e1(d 101-49-40-100
    12
    (\d 40-92-100
    13
    ellipsis … 101-108-108-105-112-115-105-115-32-8230
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: From Characters To Unicode

    Sample is in the attachment

  8. #8
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: From Characters To Unicode

    WOW! Thanks shg, this works perfectly! Now I have a second question. How do I do the opposite. The exact same thing except from unicode to characters. I will post a sample in a second.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: From Characters To Unicode

    Function SN(sInp As String) As String
        Dim asInp()   As String
        Dim iChr      As Long
    
        
        asInp = Split(sInp, "-")
        For iChr = 0 To UBound(asInp)
            SN = SN & ChrW$(asInp(iChr))
        Next iChr
    End Function
    A
    B
    C
    D
    1
    Input Output
    2
    e 101 e C2: =SN(B2)
    3
    d 100 d
    4
    1
    49 1
    5
    - 45 -
    6
    ( 40 (
    7
    \ 92 \
    8
    ed1-(\ 101-100-49-45-40-92 ed1-(\
    9
    d1- 100-49-45 d1-
    10
    \dee 92-100-101-101 \dee
    11
    e1(d 101-49-40-100 e1(d
    12
    (\d 40-92-100 (\d
    13
    ellipsis … 101-108-108-105-112-115-105-115-32-8230 ellipsis …

  10. #10
    Registered User
    Join Date
    04-19-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: From Characters To Unicode

    Thanks a lot sig, You did what I thought was impossible .Have a wonderful day

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: From Characters To Unicode

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Best way to find/replace Unicode characters
    By greek in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 05:39 PM
  2. [SOLVED] Find and replace special characters (unicode)
    By joevan1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2013, 06:05 AM
  3. show unicode characters in excel 97
    By mowali in forum Excel General
    Replies: 0
    Last Post: 03-09-2005, 01:22 PM
  4. inserting unicode characters
    By Wazooli in forum Excel General
    Replies: 1
    Last Post: 02-07-2005, 03:06 PM
  5. [SOLVED] How do I enter Unicode characters in Excel?
    By MacroAlan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2005, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1