+ Reply to Thread
Results 1 to 6 of 6

Combobox linked cell format problem

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    92

    Question Combobox linked cell format problem

    I have a combobox in sheet1 with a linked cell. When i select an entry from my dropdown (which is numbers 1-8), it changes the format on the linked cell to text. This means that my number is now stored as text.

    This causes the vlookup function (which looks up the value in the linked cell to crash because it can't match text to a number)

    Manually changing the format to "number" doesn't seem to work for me because as soon as i select a different entry from the dropdown, the format defaults back to "text".

    Any ideas how i can stop this?

    Thank you
    Schwizer

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    An ActiveX ComboBox returns a string. So unless you want to use VBA code to translate it into a value in the Change event, you can alternatively use a ComboBox via the Forms tool bar. This will return the value in the linked cell, rather than a string.

    HTH

    Jason

  3. #3
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    I'm not too familiar with activeX toolbars. I think the one i made was a controll toolbox.

    In the past i've forced a number entry using the line below, however i think this is not the best way to do things and i think it has cought up to me.

    sheets(1).range("whatever").value = sheets(1).range("whatever).value

    I also attached a quick excell sheet with just one combobox as a demo with instructions.

    PS: why in gods name does the combobox code execute when i "Save As" the file in a different name but not when i "Save" the file.

    I'm discouraged. Any help greatly appreciated.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    All controls in the Controls Toolbar are ActiveX controls. Right-click on any of the toolbars, and select the Forms toolbar. On this toolbar, use the ComboBox. It still uses a list fill range and linked cell, but it will properly return a value to the linked cell.

    I have used a forms control on the attached file for you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    Ok that works than you very much.

    Any idea why the "Save As" command executes the code on the activex drop downs but the "Save" command does not? (it can be seen in the demmo sheet if you use a break point in the combobox code)

    schwizer

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Combobox linked cell format problem

    Sorry, I am not sure how the previous post ended up in this thread.....

+ 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