+ Reply to Thread
Results 1 to 3 of 3

VBA code for assigning a numeric code to text; then numeric code populates table

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    VBA code for assigning a numeric code to text; then numeric code populates table

    I have an ActiveX combo box with several different options that are text (Educational Endorsement, License, etc.). The text options have numeric codes associated with them; therefore, I would like for the selected "text" to be converted to the corresponding numeric code (i.e. Educational Endorsement = 1 and License =2) and have the numeric code (1, 2, etc.) entered into a table. Currently, the text is entered into the table rather than the code.

    Thank you for your help.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA code for assigning a numeric code to text; then numeric code populates table

    You gave no cell references so I will have to assume. Also, there has to be a way to tell the code what text gets assigned to what value. This can be done directly in code or in a seperate cell range/worksheet. I will show in code (because it takes less of my time) and I will make assumptions on cell references (because it takes less of my time). Copy and paste to proper combobox:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA code for assigning a numeric code to text; then numeric code populates table

    Thank you!

+ 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. change text code to numeric code
    By aditya120 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2014, 08:06 AM
  2. [SOLVED] using an alpha code for numeric value
    By alialee in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-17-2014, 05:36 AM
  3. [SOLVED] VBA code to make multiple text boxes numeric entry only
    By JAL_0110 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2013, 01:57 AM
  4. [SOLVED] Combining Validation (empty and numeric) Code for ActiveX Text Box
    By VB@N3wb|3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-13-2012, 10:22 PM
  5. Numeric code of spaces!
    By Johan in forum Excel General
    Replies: 1
    Last Post: 03-06-2005, 12: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