+ Reply to Thread
Results 1 to 3 of 3

Problem with combo box

  1. #1
    Registered User
    Join Date
    04-01-2009
    Location
    Singapore, Singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Problem with combo box

    Hi everyone, a vba newbie here....i been having some problem with my vba code which i think is a subtle bug that i cannot solve. So here goes....
    I am programming a code for unit conversion which the user inputs a value into cell "G5". "G5" currently linked to "feet" in the combo box beside it. When the user click and chooses "meters" in the combo box, "G5" value will automatically change from feet to the new value of metres. However, when i use the keyboard to press keydown or keyup within the combo box, the value in "G5" becomes 0! Any idea how to solve it?
    Sorry if i could not make myself too clear but i have a attached my file to it. Thanks in advance to any kind soul to help this vba noob.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-12-2009
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 365
    Posts
    236

    Re: Problem with combo box

    Are you trying to figure out how to program comboboxes for the sake of programming comboboxes? I could suggest two things otherwise, 1st just use worksheet functions and a data validation drop down or just use online calculators such as the one at http://www.ecalc.com/calculator/scientific/
    If you can't figure out how a formula works, try stepping through it using "Evaluate Formula" in the Formula Auditing menu item in the tools menu!

    If you want to see where your code went wrong, try stepping through it by clicking in the code and pressing F8 and watch as the magic happens!


    If you are happy with any of the results, please add to the contributor's reputation by clicking the star icon.

  3. #3
    Registered User
    Join Date
    04-01-2009
    Location
    Singapore, Singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Problem with combo box

    Ha not really for the sake of programming combo boxes alone. It was meant to be flexible for many other engineering functions calculations. I got the function working. Just that i do not know what makes the subtle bug that when a user presses a keyup or keydown in the combo box, the value of the cell corresponding to the combo box becomes 0. Thanks for the quick reply anyway

+ 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