I have two sheets in Excel:
Sheet A: Drop down list with source from Sheet B
Sheet B: One column with names:
NAMES
James Gordon
Andrea Michel
Third Name
The list is very long, but unfortunately when I click on the drop down list I can't search in the list.
I need to search in the drop down list, or jump to the character which is pressed.
Any suggestion how to start?
I used an embedded combo box in a worksheet to achieve this. I created a named range with the values that I wanted to include in the combo box, then using the properties window input the named_range into the "ListFillRange" property box. This will allow the drop down box to reference this list, however I never fully figured out how to make the named range dynamically update.
To allow the list to search for included values, you need to set the "MatchEntry" property to 1 - fmMatchEntryComplete. This should achieve your desired goal.
Related
How to determine, which row was selected in a ListBox? I'm asking here because, all I have found so far, requires to loop through all rows to check if was selected or not, but I was wondering if something simple exists, as I'm using mode MultiSelect 0-fmMultiSelectSingle only an integer is expected...
If you filled the list box using the ListFillRange property, or otherwise used a contiguous worksheet range, the 3rd item in the listbox will be from the row of the 3rd cell in the range.
R = Range(ListFillRange).Rows([Listindex]).Row
where [Listindex] is the ListIndex of the selected list box item.
If this easy way isn't available, f.i. because the list was created using a filter, the thing to do is to create a multicolumn list box with an extra, hidden, column and record the row number there at the time of list creation.
You would need to loop only if the items in the list box were not extracted from the worksheet in the first place, and this is the reason why doing so wouldn't be the best solution for creating the list box's list.
I have a user form with a combo box with two columns. How do I refer to the values that are active in the combo box within VBA script on other parts of the user form (buttons, etc)?
Simply using MyComboBox.Value yields the value in the first column. I can't figure out how to refer to the second column.
EDIT: Based on advice below, I used this:
MyComboBox.List(MyComboBox.ListIndex, 1)
You don't.
The Value of a multi-column ComboBox will be the "key" value. You've presumably populated the dropdown from some list or array: use that same source to lookup the value corresponding to the selected key. Note the key/value wording: having the values in a Dictionary makes it very easy to retrieve the value of the second column.
Or, look it up from the control's List (which is essentially a copy of your items source), using the ListIndex, which gives you the index of the selected item in the source list.
You can have a Property Get procedure responsible for this lookup - then other parts of the code can easily consume it as needed.
Private Property Get SelectedItemDisplayText() As String
SelectedItemDisplayText = MyComboBox.List(MyComboBox.ListIndex, 1)
End Property
Normally you only care for the selected "key" (/"ID"), not the "display value" though.
I'm looking for the solution in excel data validation for 2 drop down list.
When I choose 1st drop down list 2nd drop down list will auto populate the correct value from table. If user choose 2nd drop down list 1st drop down list will auto populate the value also.
Can someone help me on this issue ?
I attach the sample file for my problem.
enter image description here
enter image description here
thanks!
Sample File
Trying to do a two way I don't think is going to work in the way you are trying so I am not surprised the examples you found were for one-way. I am open to being corrected.
You could hack around it for example using two form control listboxes linked to the same cell so a selection in one updates the other.
Then because an item might be out of view listbox underneath have two cells which use the linked cell to index back into the source lists.
In the example above, there are two list boxes from form controls in developer tab (customize ribbon > add developer tab.
Developer tab form control - 2nd from the right
You add two of these in to the sheet.
Right click format control on each one
Set the input range to the range containing your list of values for that listbox and set the linked cell e.g. G1
Ensure that whilst you select different input ranges for each list box, they should have the same linked cell e.g. G1.
Underneath the listboxes put a formula which uses the linked cell G1 to index back into the source lists for each listbox so you can retrieve the selected value and have it visible, in case not visible within listbox.
Example testing:
I'm working with VBA, Excel. I have some set of words, say 10.
When I choose a particular column, then what ever I enter in that coulmn must be from those selected set of words.
It's like dropdown list but I really donot want to use dropdown list. This must be done to a column(or set of cells).
Hey you should be able to do it just like dropdown list but without in-cell dropdown option marked. Its an option that is automaticly marked when you validate column by list in validation form.
I have a cell with a dropdown menu of 20 items in a list. Upon clicking one of these 20 items, I want the next cell to produce another drop down with a list of options. The list in this dropdown will differ depending on what choice is taken from the first drop down. Following this, I want the chosen option in the second dropdown to output a number in another cell. Thanks.
You'll have to start by creating Named Lists of dependent list, and use INDIRECT function in Data Validataion -> List to achieve dependent drop down list or cascading drop down list.
Its explained in detail with screen shots here!
Refer this link if you are using older Excel version.