Populate Combobox List With ONLY Unique Items ()
Nov 16, 2006
Populate Adv Filter Criteria from Inputbox with valid data
I've set up a macro to extract 3 different sets of data using Advanced Filter (same data range, different criteria & extract ranges)
There are multiple options (different individual dates) to satisfy the criteria (a date) for each of the 3 extracts and I want the user to select the criteria (a specific date) from the range of unique values in the data range upon which the Advanced Filter criteria is going to be applied. (A bit like the effect provided by Autofilter)
My initial attempt was to capture the criteria date from the user and populate a cell, and then have a vlookup function in another cell check if that crieteria value exists in the specified range. I then ran a loop in the VBA code until the value is valid (ie. exists in the range). However, to streamline this I was hoping to allow the user to see a list of the valid (available) dates when they respond to my Inputbox request for the criteria.
View 9 Replies
ADVERTISEMENT
Dec 19, 2006
I have a combo box (from the Control Toolbox toolbar). I like this to be populated with the contents of column A. however, in column A there can be duplicates. I obviously don't wan't any duplicates in the combobox.
View 9 Replies
View Related
Aug 30, 2006
I have a database of data that looks like this
Centre Name Training Type Expert 1 Expert 2 Expert 3 Expert 4
MyCentre MyTraining Me
MyCentre MyTraining Me
MyCentre MyTraining Me
MyCentre OtherTraining Me
NewCentre NewTraining NewPerson
I am trying to create a user form (in VBA) with a combo box that has each centre name appear only once (despite the fact that in the database each occurs multiple times). When a specific centre is selected, this brings up all the different training types associated with that centre in a separate list box. When that training type is selected, it should bring up all of the experts in that training type (for the specific centre). I should mention that the range is static (though the data is always contiguous) as the database is updated on a going forward basis.
View 2 Replies
View Related
Aug 31, 2006
I need to add about ~200 items to Combo From Other Excel File (with no duplcates).
How to make it.
Private Sub UserForm_Activate()
With cboComp
.addItem "item"
End With
End Sub
View 3 Replies
View Related
Jul 26, 2012
I found this thread which deal with populating unique values in my listbox.
Here is the thread link. [URL] ........
What these line of code mean (the ones in red).
Code:
Private Sub UserForm_Initialize()
Dim v, e
With Sheets("maintenance").Range("c2:c500")
v = .Value
End With
With CreateObject("scripting.dictionary")
[Code] ......
Note : I simple tried to check the value of v by giving msgbox (v), just below the line v = .Value.
But I got run-time error 13 : Type mismatch error.
View 5 Replies
View Related
Jan 11, 2013
The code below extracts unique distinct values from column A, except cell A1. Then the code adds the extracted unique distinct values to the combo box.
Sub FilterUniqueData()
Dim Lrow As Long, test As New Collection
Dim Value As Variant, temp() As Variant
ReDim temp(0)
On Error Resume Next
With Worksheets("Sheet1")
[Code]....
The vba code below copies the selected value to cell C5 whenever the combobox is selected
Copy the code into a standard module.Assign this macro to the combobox
Sub SelectedValue()
With Worksheets("Sheet1").Shapes("Drop Down 1").ControlFormat Worksheets("Sheet1").Range("C5") = .List(.Value)
End With
End Sub
Vba code belows instanly refresh the combobox when values are added/edited or removed from column A,
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("$A:$A")) Is Nothing Then
Call FilterUniqueData
End If
End Sub
My problem is this:
Everything will be working fine if the all combobox and data can be found in 1 sheet, but how could i make some tweaks if the combo box is located in sheet 2 provided your data to be populated is in sheet 1, i tried everything but the combobox doesnt update,
View 1 Replies
View Related
Jul 17, 2009
I know how to use array formulae to create a unique list, i.e.{=INDEX($G$1:$G$760,SMALL(IF(ROW($G$1:$G$760)=MATCH($G$1:$G$760,$G$1:$G$760,0),ROW($G$1:$G$760)),ROW()))}
however this is giving all the unique items from column G and I only want the unique items that have a non-zero value in column H as well. This would be the sumif of all instances that would have to be zero. I've tried to crack it and I've tried to search for solutions but so far no joy.
View 9 Replies
View Related
Jun 15, 2009
I have a list of >50 contract numbers listed in cells A1:A350, with several of the numbers listed more than once. What I would like to do is, on a separate worksheet, list each contract number only once, in column A.
View 9 Replies
View Related
May 9, 2008
The code for sorting a multi-column listbox in Retain Selection After Sorting ListBox was really good, and I've used it a lot in an application I'm building.
What I'm hoping to do is reload a listbox in such a way that the items appear in the same order they were previously in. I'll describe two scenarios:
1. User edits a record
- user sorts listbox
- user selects a record
- user edits record
- listbox reloads, unsorted
2. User adds a record
- user sorts a listbox and sees a record is missing
- user adds the missing record
- listbox reloads, unsorted
ideally the last step for each would be "listbox reloads, sorted" and the user would go on down the list. the tricky part i think is when rows are deleted or added.
i'm starting on a solution, but if there's some existing code that will do this i'd appreciate if someone could point me to it (because, for example, the listbox sorting code i referred to above anticipated things i did not).
View 9 Replies
View Related
Sep 13, 2012
I have a sheet of un-ordered data with duplicates. Looks a little like this:
Sheet2
*
A
B
[Code]....
What I want to do is: on a separate sheet, when the user inputs a Region name, it will return an array of unique Locations under that Region. For example, if the input is "NORTHEAST", the following would be returned:
Sheet3
*
A
B
C
[Code]....
View 7 Replies
View Related
Jul 4, 2009
i had a user form with a Combo box,list box,text box and a command button. I need the code that works upon selecting:
1)An Item from the combo box should display the list in the list box.
eg: If Country is selected from the combobox then the list box should contain all the names of the countries from the country Column
2)An item should be added to the list in the worksheet when an item is entered in the textbox.
Like wise, when an item is selected from the combobox from "Delete Items List" all the items relating to the item selected from the combobox should be displayed in the list box and a choice to delete the items relating to the combobox item should be provided.
View 4 Replies
View Related
Nov 23, 2006
I have a userform, on the user form I have a combo box. when i select an item from the combobox list. I want it to show only that item in the pivot table.
Code:
Dim i As Integer
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Description")
For i = 1 To .PivotItems.Count
If i = ComboBox2 Then
.PivotItems(i).Visible = True
Else
.PivotItems(i).Visible = False
End If
Next
End With
View 9 Replies
View Related
Feb 12, 2009
I have a column that looks something like (it is VERY long and has over 20 different names):
abe
abe
abe
abe
ben
ben
ben
cat
cat
john
john
john
john
tex
tex
I want to create another column (automatically) that lists each of of those once:
abe
ben
cat
john
tex
Any idea of how I can do this automatically?
View 12 Replies
View Related
Jan 5, 2008
I used this forum to find code to convert a matrix to a list. But I need to repeat then change one column - "Product".
The "Prodcut" vlaue needs to repeat unitl it changes.
I have attached a file with the code in module 1, and samples of where I am, and where I need to be. I think I am close!
View 9 Replies
View Related
Jul 12, 2007
I have 2 columns of data on Sheet2. The first is Product in column B. The second is Benefit in column C.
I need to look at product column B on Sheet2 and add unique items to my first Combobox after the command Userform1.show.
The person using the form will select a product from Combobox1 and then Combobox2 should add the corresponding Benefits from the benefits column on Sheet2.
As a side note: I expect products and benefits will continue to be added to columns B and C in the future so I can't have a "hard-coded" set of rows if that makes sense.
I've pasted a small 2 product example of Sheet2 below.
ProductBenefit
Account DefenderLoss of Life
Account DefenderDisability
Account DefenderInvoluntary Unemployment
Account DefenderLeave of Absence
Account SecurityLoss of Life
Account SecurityDisability
Account SecurityInvoluntary Unemployment
Account SecurityLeave of Absence
Account SecurityHospitalization
Account SecurityNursing Home
View 8 Replies
View Related
Aug 17, 2012
Is there an easy way to populate a combobox with a list of directories on the hard drive?
I want to create a way for a user to specify a file without having to type in the full address by hand.
I would like to start in the c:/ root and list the directories in one combobox and the excel files in another combobox. Then if they select say "desktop" it displayes the directories in "c:/desktop" and the excel files contained there in. Then if they click test it does directories in "c:/desktop/test" and so on.
View 2 Replies
View Related
Jan 8, 2008
I have two worksheets: A and B.
Worksheet A:Contains 2 columns: Issue# (Col. A) and Program (Col. B).
Issue# contains a list of multiple issues. There are several instances in which the issue# is repeated.
Any particular Issue# field may have several issues in it, delimited by a comma.
Program is a program associated with the issue and this column also contains duplicates.
Worksheet B:Contains 1 column: Issue# (Col. A)
This is a unique list of issues#'s.
All Im looking to do is parse all Issue#'s from Worksheet B and have some way of knowing if that issue# is anywhere in Worksheet A. Most importantly, I need the "indicator" to be displayed on Worksheet A. This way I can see what program(s) is/are associated with the matching issues.
A couple other notes:All Issue#'s in Worksheet B are referenced at least once in the Worksheet A Issue# list
There are several issues in Worksheet A which are not referenced in the issue list on worksheet B (of which I dont care about)
I really hope that makes sense, but if not...
Here's the best example I could come up with: ....
View 9 Replies
View Related
Jun 1, 2006
I need to count the unique for a customer. The areas to be counted are separated by blank lines. At present, I am using sumproduct(1/countif(range1,range1), to count the unique items. This formula works perfectly except that it takes me almost an hour to do this for all the measurements. Is there a macro that can provide me with the same results -- putting the same values where I am presently have the formulas (the cells that before the blank lines)?
View 6 Replies
View Related
Jan 24, 2008
I am trying to create a form with a combobox drop down menu. The list I need displayed is in cells C4:C20 but I only want to show unique values not all of them.
View 9 Replies
View Related
May 22, 2012
Using excel 2007. I have a column with multiple items, a lot repeated.....how do I make a to show just one of each item? I want a unique list of my column of repeated items.
View 3 Replies
View Related
Feb 11, 2012
I have five comboboxes in userform1, they are link to Column A, Column B, COlumn E, Column G and Column Z of "Reference" worksheets respectively. The values in each column could contain duplicate values. However, I'd like to only display the unique values in those combo boxes and I have no clue how to achieve this.
View 7 Replies
View Related
Feb 25, 2008
i have a list of surnames in column A in a spreadsheet i want to use this for the source of the combo box also i want this list to be unique and if the surname is not present i want to be able to put the name in the combo box and add it to the sheet
View 2 Replies
View Related
Aug 21, 2014
Excel 2007 and very new to VBA...
I have a userform (named "QAReviewForm") with a combobox (named "cboSupName"). I want it to populate with my named range "SupList".
FYI, the SupList is found on sheet 2, "Administrative Menu" in column E. E1 contains the heading "Supervisors", and my named range formula is
Formula:
[Code ] .....
When it runs, my form opens and the combobox is there, but nothing appears as options for me to select (yes, I have some values in column E).
View 11 Replies
View Related
Jan 21, 2014
Excel 2010. There is a limit to the usability of the
=INDEX($A$1:$A$1000,MATCH(0,COUNTIF($A$1:$A$1000,"<"&$A$1:$A$1000),0))
method. It seems like the limitation is in the Countif function going over 1000 (or some other size limit)
I have a list of ~1500 rows, of that there are approximately 55 unique items. Doing the unique array works correctly up until item ~40, upon which it fails by returning the 1st item only (for the rest).
Trying to debug, and pulling out the Match section, it functions up until 976 (that is
MATCH(0,COUNTIF($N$1:$N40,$C$3:$C$1500),0)
returns 976) anything after returns just 1 (1st item).
It seems to be a limitation on the text string size that COUNTIF can handle.
View 7 Replies
View Related
Feb 13, 2014
im looking to have a drop down list on sheet2 that displays unique items in column A on sheet 1.
then when an item is selected from the drop down list, i want to be able to display all unique values that correspond to that option. i have attached an example worksheet
data on sheet1 is ever changing
View 4 Replies
View Related
Mar 30, 2009
Am trying to get dynamic population of 2nd combobox based on match from criteria in combobox 1.
if column a = bears and column b = colours of bears then
when I select bears in combobox one, combobox 2 would populate with colors of bear.
I am think of having a combobox 1 change event that evaluates each row in a specific range (does it match the criteria?) if so, then add 2nd cell (column b) of that row to the combobox 2.
I know it would probably involve match and offset, add item and loop, but I am not sure what the syntax is.
View 9 Replies
View Related
Mar 30, 2014
I need to populate two combo boxes from excel sheet, the data will be like below:
Column A Column B
A 1
A 2
A 3
A 4
A 5
B 100
B 101
B 102
So from the above data, one combo box should hold unique values A & B.
On selecting a value from the 1st combo box A or B, respective values should be populated in 2nd combo box.
So the data should be like below:
If A is selected in the 1st combo box, then 2nd combo box should only show the values 1,2,3,4 & 5.
If B is selected in the 1st combo box, then 2nd combo box should only show the values 100,101 & 102.
Friends I need it in a macro and one important point is, this is dynamic and it is not static and the data can be more.
View 1 Replies
View Related
Jun 12, 2006
I have a table, headers "FirstName" and "SurName".
Further a Userform with 2 Comboboxes "FirstName" and "SurName"
I'd like to choose the FirstName (say Jack) in the "FirstName" combobox, and based on that get the choice of the Surnames of all my Jacks in the "SurName" combobox.
Actually my sheet has much more fields and comboboxes, but i think my problem is just that I do not find a way to populate them dynamically.
View 9 Replies
View Related
Dec 26, 2013
I am wanting to create a list where I can select multiple items within that list and then print only those selected items. I have created something similar thru data validation, but I can't get it to print.
In addition, I would like to be able to subdivide the list into multiple categories, then select items from these multiple categories and print them.
View 3 Replies
View Related
Mar 13, 2009
The below code shows the way I add items to 10 different comboboxes. However, the items to be added are actual the same.
Is there a way I can simiply it? I am worry that by the end of day, i might have up to 50-60 comboboxes and the code will be a relativity long and not efficient.
Taking into consideration the the comboboxes will be labelled as Jieyi_task_ComboBox1...to 10
jane_task_ComboBox1...to 10
Kenny_task_ComboBox1.. to 10
View 8 Replies
View Related