Consulting

Results 1 to 13 of 13

Thread: Solved: Assign data to Combo Box

  1. #1

    Question Solved: Assign data to Combo Box

    Hi all,
    I need help again with vba. I try to create a few items assigned to the combo box. Whatever the user select the value returns to another cell. I did try the validation, but didn't get the result i wanted. Please help.

    Thank you all very much!

    Please see the attachment.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    You have to go into design mode and look at the properties for the combobox to see how this works....look at column count, bound column, linked cell and linked fill range.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Lucas, you're truly a master of excel . Thank you so much.

    Cheers.

    P.S. My first week of entering the vba code madness....

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Master...........not really....on a long learning curve myself
    Your welcome, and we didn't even touch on vba.............
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hello Lucas,

    I happened to see your post and it's very interesting .. except that I dont know how to duplicate the link function
    So far, I can use validation to create a simple dropdown box but how do I link the value (5, 10, 15 ..) to cell B10? Also, how do I show the property of the combobox.

    Pls land a hand again,
    Thanks a lot!

    Nee

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Nee,
    Download the file from post 2 of this thread
    Open the excel file
    right click on any toolbar(you should get a list of available toolbars)
    Look for the one that says "Visual Basic" and make sure its checked
    the visual basic toolbar will open somewhere on the screen
    look towards the right end of the visual basic toolbar for a button that says "Design Mode" when you hover over it.
    click the design mode button and you should then be able to right click on the combo box and look for "properties"
    then read post 2 again and look at the items mentioned there in the properties of the combobox....see the connection?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    PS Nee,
    the combobox used on the example was created with the control toolbox not the forms toolbar. If you look on the visual basic toolbar for the control toolbox you can add these activeX comboboxes to your spreadsheet.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  8. #8
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Also don't forget to exit design mode when your finished
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  9. #9
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hello Lucas:

    Fantastic help! especially on a "solved" post.
    And thanks for pointing out that the box was created from "the control toolbox not the forms toolbar" !

    I sailed along pretty smooth until ... well I failed at getting the correct value on to linked cell B10
    from the original post, fillrange is J1:K5 and linkcell is B10
    I set my fillrange at M1:N5 and linked cell B11, but I cant get the correct
    value to cell B11????

    Thanks in advance for your kindness and patience with a beginner ..

    Nee

  10. #10
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Lucas,

    Never mind my slowness. I found what I missed and now I can get the correct data to linked cell B11.
    Again, thanks so much for the step-by-step instruction on how to deal with the control toolbox droplists. Very helpful and now I am more than one step ahead of the upcoming project!!!!

    Very grateful to you

    Best regards,
    Nee

  11. #11
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Your welcome Nee, glad to help....maybe you can return the favor one day when someone is trying to figure this out...
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  12. #12
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Absolutetly - and how much I long for the day when I can provide instead of asking for tips ..
    Thanks again and take care!

    Nee

  13. #13
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    It will happen before you know it. There are some high caliber contributors at this site but sometimes its something I have tried or seen in the forum and I get to try to help someone. Responses like yours are very gratifying.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •