VBA dropdown selection - excel

Hi i have a worksheet contain six columns, instead of use the Filter function from excel, I would like to create a dropdown menu that allows me to select the information from column A (strings) and then select information from colomn F (also string), how can I create that dropdown from VBA?
Thanks,

Your question isn't fully clear to me in terms of what sort of functionality you want this drop-down menu to have, but you would be best off to investigate the following:
A) Developer Tab > Insert > List Box
You can specify a data range for this drop-down menu and link it to a cell which updates its value based on the drop-down list selection.
B) Data Tab > Data Validation > Allow: List
This allows you to select a list of data that you want to have appear in a particular cell.
Perhaps these would be useful for what you are looking to accomplish.

Related

How to create a dropdown clickable checklist that fills an Excell cell?

I have a single cell A2 that needs to be filled with a string that's one or more items from a given list with 20 items. We have to manually input these values in alphabetic order separated by ";".
Is there a way that we can have a dropdown list on cell A2, that we could pick these values from a checklist, and by clicking on them, they would get inserted?
If so, how can I have this and use it for several rows (A2-A366) where each row is a different data entry for another day but with the same logic?
Create a Drop-down List
To create a drop-down list in Excel, execute the following steps.
1. On the second sheet, type the items you want to appear in the drop-down list.
Note: if you don't want users to access the items on Sheet2, you can hide Sheet2. To achieve this, right click on the sheet tab of Sheet2 and click on Hide.
2. On the first sheet, select cell B1.
3. On the Data tab, in the Data Tools group, click Data Validation.
The 'Data Validation' dialog box appears.
4. In the Allow box, click List.
5. Click in the Source box and select the range A1:A3 on Sheet2.
6. Click OK.
Result:

ms excel - data validation for 2 drop down list

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:

Excel List or Combo

Have 56 individuals that I want to list in a drop down box (Combo or List). I want to be able to select on and then select from a range of different options with the result being the correct info based on the option and the individual. How can I do this easily please
Are you looking for something like this (through to 56 though)?
enter image description here
enter image description here
Data validation.
Google Spreadsheet:
1. Select the cell you want to create the drop down list,
2. Go up to 'Data',
3. Select 'Data Validation' from the menu,
4. Criteria: 'List from a range',
5. Select the range (you could leave an entire column for the items you want to list, should it ever be greater than 56),
6. Save
Excel (using 2011):
1. Select the cell you want to create the drop down list,
2. Go up to 'Data' sub-tab,
3. Click 'Validate',
4. Under the 'Settings' tab of the Data Validation window; Allow: 'List',
5. Source: (the range of values you want to appear in the list). Like in the Google Spreadsheet version, if you want to allocate that entire column to the data that should populate the drop down menu, choose, for example: =$B:$B
Hope this helps/is what you were looking for.
(Edit: formatting for clarity)

how to limit excel column to limited number of words

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.

Type in a data validation cell

I am using data validation to offer a list of choice for each cell in a column. Is there a way to make it possible to type in each cell, rather than have to select from the drop down list?
The drop down list is quite long so would like to search it.
The default setting when a data validation dropdown list is created is to allow the user to type in the cell as well. Is this an active-x control dropdown or just a dropdown in the cells?
If it is just in the cells, then select the cell, go to Data-> Data Validation -> Validation -> then unselect the checkbox that says select from drop-down list.
If it is a VBA control, it would have to be replaced with an inputbox both in the sheet and in the code.

Resources