Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default dropdown value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default dropdown value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default dropdown value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default dropdown value

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
select From dropdown and return another dropdown menu RE4379 Excel Discussion (Misc queries) 2 March 11th 10 03:09 PM
Dropdown box display only data dependent on another dropdown box? Chris Excel Worksheet Functions 8 August 5th 08 05:01 PM
populating a dropdown based on choice from a previous dropdown Conor[_3_] Excel Programming 2 March 9th 06 07:15 PM
offer dropdown options based on another dropdown Conor Excel Discussion (Misc queries) 2 January 13th 06 04:28 PM
How do I create a dropdown within a dropdown? Joyce Keller Excel Discussion (Misc queries) 1 December 5th 05 04:02 PM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"