+ Reply to Thread
Results 1 to 15 of 15

combobox result coming as text, not numeric

  1. #1
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    combobox result coming as text, not numeric

    I created a activex ComboBox (under form controls) to show numeric figures.However, the combo box linked cell is showing the numbers as text.

    How can I correct this issue?

    btw...i run Excel 2007 version.

    Thanks in advance.

  2. #2
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: combobox result coming as text, not numeric

    can you upload the workbook? have you tried the =value and copy paste speacial > values?
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: combobox result coming as text, not numeric

    The most likely cause would be that your linked cell is formatted as Text. Even if your initial list cells are formatted as text, the linked cell should report the result as a number.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: combobox result coming as text, not numeric

    Here are some attachments; the jpeg will indicate the issue at hand.

    To ChemistB, I tried to format the linked cell to show numeric value, but every time I change the figure on the combo box, the formatting gets undone. (I wish to show the linked cell result as #" eg:- 48")
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: combobox result coming as text, not numeric

    Don't use a linked cell - it will always be text. Use code in the combobox to populate the cell instead.
    Remember what the dormouse said
    Feed your head

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: combobox result coming as text, not numeric

    I used a spare cell to link to the combo, H5.

    The in B26 I used the formula =H5*1
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: combobox result coming as text, not numeric

    OK, that would work. But I am still in the issue of the linked cell automatically reformatting to its original state every time I make a choice on the ComboBox.

  8. #8
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: combobox result coming as text, not numeric

    Quote Originally Posted by romperstomper View Post
    Don't use a linked cell - it will always be text. Use code in the combobox to populate the cell instead.
    ummm....ok......how?

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: combobox result coming as text, not numeric

    Like this.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: combobox result coming as text, not numeric

    yeh, that's more or less it. But I can't seem to access your Comboboxes.

    Any reason why?

  11. #11
    Registered User
    Join Date
    09-18-2009
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: combobox result coming as text, not numeric

    Never mind!!!

    I applied your code, and the the thing is working like a charm. Thanks!!! I am sooo not good with code-writing. Recommend any good sites to learn from?

  12. #12
    Registered User
    Join Date
    12-11-2011
    Location
    Christchurch
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: combobox result coming as text, not numeric

    Hi Guys,

    I am new to this forum.

    I am facing the same problem with Combo boxes. The linked cell is showing the numbers as text. I could not find the code you guys are talking about to solve my problem. Please help.

    Thanks.

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: combobox result coming as text, not numeric

    If you put it into design mode and right click on the combo box> View Code, it'll open the VBA editor. The code is embedded into the sheet module so right click on your sheet tab and "View Code" and paste the code in (modifying it for your cell destination).

  14. #14
    Registered User
    Join Date
    10-09-2013
    Location
    Frankfurt am Main, Germany
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: combobox result coming as text, not numeric

    I found very helpfull your file.

    Thank you,

    ShpendG

  15. #15
    Registered User
    Join Date
    06-06-2014
    Posts
    1

    Thumbs up Re: combobox result coming as text, not numeric

    Quote Originally Posted by jalba View Post
    I created a activex ComboBox (under form controls) to show numeric figures.However, the combo box linked cell is showing the numbers as text.

    How can I correct this issue?

    btw...i run Excel 2007 version.

    Thanks in advance.
    Hi,

    Use 'Val' function in the code where you want to display the results.
    eg:- activecell.offset(0,3).value = val(cboSalary.value)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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