DropDown list help

edlim85

Board Regular
Joined
May 4, 2009
Messages
178
hi there,

its my first time to venture into userforms and dropdown list. I have searched the web, I would like to further ask a few questions

  1. To create a Yes/No dropdown(or any other dropdown), i use data validation in excel?
  2. Say i have a few Dropdownlist in "sheet1", how do i set my dropdown in vba coding? ie Set DP1 = "dropdown list in cell D2"
  3. How do i extract the selected value in the drop down to use in vba coding?
    In above case, I will need to let excel vba know if user select "yes" then 'action'
Pls advise
thank you in advance!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
thanks Ross,

I still have the following question which i cant seem to find

  1. Say i have a few Dropdownlist in "sheet1", how do i set my dropdown in vba coding? ie Set DP1 = "dropdown list 1 in cell D2"
  2. How do i extract the selected value in the drop down to use in vba coding?
    In above case, I will need to let excel vba know if user select "yes" then 'action' ...So far i came across the property .list and .listindex but cant seem to understand how shld i use it.
Pls advise
 
Upvote 0
I have input yes/No using data validation, this creates a in cell dropdown.
How do i go about naming the dropdown to be use in my excel vba codes?
 
Upvote 0
Hello edlim85,

When a choice is made in a Validation Dropdown, the cell will reflect that choice. As an option, you can choose a "link cell" that will display which row in the list the choice is. If your list is "Yes" and "No" then choosing "No" would place a 2 in the link cell.

As for the Dropdown's name, Data Validation drop down lists usually point to range of cells. There is no object name, unless you are using a named range. A named range is VBA is accessed like this: Range("MyRange").

An ActiveX ComboBox will have a name like ComboBox1, ComboBox2, etc. The Forms controls have names like "Drop Down 1", "Drop Down 2", etc. To get the object's name, right click the object and look in the Name Box on the worksheet. Upper left corner adjacent to the Formula Bar.
 
Upvote 0
Hi Leith Ross,

Thanks for the advise. I will take my time to digest and read up the link you provide me. :)

Many thanks!

Regards
Edmund
 
Upvote 0

Forum statistics

Threads
1,224,593
Messages
6,179,791
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top