+ Reply to Thread
Results 1 to 5 of 5

Get text using number codes

  1. #1
    Registered User
    Join Date
    07-18-2007
    Location
    US
    Posts
    33

    Get text using number codes

    I have this spreadsheet where I use the numbers 0-9 to reference colors (similar to wire insulation color or the color bands on resistors).

    What I want to do is have a column reference 2- and 3-digit number codes and call out the colors.

    Example:

    A B

    0 BLACK
    1 BROWN
    2 RED

    01 BLACK-BROWN
    02 BLACK-RED

    The spreadsheet I attached shows examples of exactly what I wanna do. But I have a lotta numbers so I was hoping there would be some formula to help.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You could use this UDF:
    Please Login or Register  to view this content.
    So =Colors("0123") returns BLACK-BROWN-RED-ORANGE

  3. #3
    Registered User
    Join Date
    07-18-2007
    Location
    US
    Posts
    33
    something's not right, I keep getting the #NAME? error, i think i'm calling the function wrong

    could you attach a spreadsheet of how you would do it?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    1. Copy the code from the post
    2. Press Alt+F11 to open the Visual Basic Editor
    3. From the menu bar, do Insert > Module
    4. Paste the code in the window that opens
    5. Close the VBE to return to Excel

  5. #5
    Registered User
    Join Date
    07-18-2007
    Location
    US
    Posts
    33
    Ok i got it now, and searching through excel and VBA's help files I was able to actually understand how it works, but where can I find a list of the character codes that the Asc function uses?

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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