Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
i would like to know how i can display the value of a dropdown box in a messagebox. does anyone know how i can do this? thanks in advance, geebee |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First find what your RowSource is, once you know,
in your code you do something like this p = UserForm1.ComboBox1.Value MsgBox (p) -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "geebee" wrote: hi, i would like to know how i can display the value of a dropdown box in a messagebox. does anyone know how i can do this? thanks in advance, geebee |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
this will not work. the combobox is not in a userform. it is in a sheet of the workbook. would there be different code? thanks in advance, geebee "Michael" wrote: First find what your RowSource is, once you know, in your code you do something like this p = UserForm1.ComboBox1.Value MsgBox (p) -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "geebee" wrote: hi, i would like to know how i can display the value of a dropdown box in a messagebox. does anyone know how i can do this? thanks in advance, geebee |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are two type of combo boxes, on under the Forms Menu and one under the
visual basic menu. The first one will allow you to right click on it and you can select format control from the menu this will bring a window with 5 tabs one of them named control, in there you will see the the cell link say for example A1, and the input range $A$2:$A$10 Then type this on your code: i = Range("A1").Value p = Cells(1, 1).Offset(i, 0) ' The 1st number is your row, and the 2nd is your column MsgBox (p) For the second type of combo box, you must first click on the design icon, so it will allow you to select the object by righ clicking on it; once the menu shows, select properties and click on the categorized tab, look under the misc category and where it says linkedcell you will see a cell reference for example C5, place the code below: p = Range("C5").value MsgBox (p) This should work, unless is not a real dropdown but a data validation cell. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "geebee" wrote: hi, this will not work. the combobox is not in a userform. it is in a sheet of the workbook. would there be different code? thanks in advance, geebee "Michael" wrote: First find what your RowSource is, once you know, in your code you do something like this p = UserForm1.ComboBox1.Value MsgBox (p) -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "geebee" wrote: hi, i would like to know how i can display the value of a dropdown box in a messagebox. does anyone know how i can do this? thanks in advance, geebee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select From dropdown and return another dropdown menu | Excel Discussion (Misc queries) | |||
Dropdown box display only data dependent on another dropdown box? | Excel Worksheet Functions | |||
populating a dropdown based on choice from a previous dropdown | Excel Programming | |||
offer dropdown options based on another dropdown | Excel Discussion (Misc queries) | |||
How do I create a dropdown within a dropdown? | Excel Discussion (Misc queries) |