Consulting

Results 1 to 17 of 17

Thread: Drop-down menus

  1. #1

    Drop-down menus

    Hello,

    It will be very much appreciated if someone can please give me an example of creating a "drop-down menu" on a excel spreadsheet?
    Many thanks

    yours,
    Ed

  2. #2
    Menu: Data > Validation > Allow: List > Source: manually enter values (separated by , refer to a range of cells (A1:A10), or a name that you defined elsewhere

  3. #3
    Thank you LitVikas but anything with regards to to "ComboBox", or "SpinButton"?
    Please let me know, many thanks

    yours,
    Ed

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    http://www.erlandsendata.no/english/...nloaduserforms

    3rd item on the page. Hope this helps. If you have more questions post back.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    What your looking for is activeX controls
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  6. #6
    Many thanks Lucas.
    will have a look into it.

    Yours,
    Ed

  7. #7
    Thank you Lucas, that was very helpful.
    However, can anyone advise me on the 2 problems below.

    1)To use mouse Scroll on ComboBox

    2)The codes to retrieve the selection in the combobox (i.e. if combobox contains an entry "I Am beAuTiFul :P", what is the code to retieve "I Am beAuTiFul :P" and mgsbox it)

    Many thanks

    yours,
    Ed
    Last edited by photon_ed; 08-05-2006 at 08:56 AM.

  8. #8
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Ed.
    I don't really understand your questions. As for mouse scroll, do you mean after you drop the combobox to be able to scroll using a mouse wheel through the selections?

    Could you post a small sample file with your combobox so we can see what your working with please.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  9. #9
    hi lucas,
    Thanks for the prompt reply.
    Your description with regards to the mouse scroll was exactly my question.
    As to my second question, there must be a way to use the information after the combobox contains a selection.
    It will be very much appreciated if you can let me know.
    Many thanks

    yours,
    Ed

  10. #10
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    This code is for a combobox created with the forms toolbar....not the activex control but it shows how to put the selected item in a cell.....not sure what your trying to do. You can change the line activecell.value to whatever your trying to do with the data:
    [VBA]
    Sub Control_on_Worksheet()
    Dim mypick As Variant
    With Worksheets("Sheet1").DropDowns("my control")
    ' Set the value of mypick to the index number
    ' of the item chosen in the drop-down.
    mypick = .ListIndex
    ' Extract the actual item and put it into
    ' the active cell on the worksheet.
    ActiveCell.Value = .List(mypick)
    ' Empty out the drop-down.
    .Value = 0
    End With
    End Sub
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  11. #11
    WHats "my control" in the case Lucas?

    yours,
    Ed

  12. #12
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    If you right click on the combobox in this example you will see the name of the combobox(control) in the names box to the left of the formula bar
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  13. #13
    Thank you for the example Lucas, but there maght be an error on your example worksheet. It pops up saying "Control_on_Worksheet not found" when I pick a selection.
    THanks

    yours,
    Ed

  14. #14
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Maybe someone else would be willing to download it and tell us if they are having problems with it. I just downloaded it and it ran fine on my machine?!
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  15. #15
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    quick question Ed, did you actually download it to your hard drive or did you just click on the link to run it?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  16. #16
    MAny apologize Lucas, I only just open it
    ITs works fine, will take a look at it.
    MAny thanks lucas!

    yours,
    Ed

  17. #17
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Not your fault Ed, Malcolm has started a thread addressing the fact that some users are having a problem when trying to run files from the link instead of downloading by right click and choose save as.

    See this thread Ed if you don't mind and post what happened so we can get an idea of how many folks are having this problem. Don't forget to post in the poll too.

    http://vbaexpress.com/forum/showthre...0283#post70283
    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
  •