PDA

View Full Version : Drop-down menus



photon_ed
08-04-2006, 06:29 AM
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

LitVilkas
08-04-2006, 07:10 AM
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

photon_ed
08-04-2006, 08:02 AM
Thank you LitVikas but anything with regards to to "ComboBox", or "SpinButton"?
Please let me know, many thanks

yours,
Ed

lucas
08-04-2006, 09:09 AM
http://www.erlandsendata.no/english/index.php?d=endownloaduserforms

3rd item on the page. Hope this helps. If you have more questions post back.

lucas
08-04-2006, 09:10 AM
What your looking for is activeX controls

photon_ed
08-04-2006, 09:46 AM
Many thanks Lucas.
will have a look into it.

Yours,
Ed

photon_ed
08-05-2006, 08:42 AM
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

lucas
08-05-2006, 09:02 AM
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.

photon_ed
08-05-2006, 09:36 AM
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

lucas
08-05-2006, 09:43 AM
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:

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

photon_ed
08-05-2006, 10:03 AM
WHats "my control" in the case Lucas?

yours,
Ed

lucas
08-05-2006, 10:18 AM
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

photon_ed
08-06-2006, 06:23 AM
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

lucas
08-06-2006, 07:02 AM
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?!

lucas
08-06-2006, 07:03 AM
quick question Ed, did you actually download it to your hard drive or did you just click on the link to run it?

photon_ed
08-06-2006, 07:10 AM
MAny apologize Lucas, I only just open it :)
ITs works fine, will take a look at it.
MAny thanks lucas!

yours,
Ed

lucas
08-06-2006, 07:17 AM
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/showthread.php?p=70283#post70283