Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good Day Group,
When using the below code to "fill" a ComboBox how to ensure that only unique text will be added. The text that is in Range ("A1:A1000") is of this type: 001 001 001 002 003 003 004 as a result I would like the combobox listtext to show 001 002 003 004 etc Brgds CG Rosén ---------------------------------------------------------------------------------------------- With Worksheets("Sheet").Range("A1:A1000") Set k = .Find(nr, _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByColumns) If Not k Is Nothing Then firstAddress = k.Address Do r = k.Row Me.ComboBox1.AddItem Mid(Sheets("Sheet1").Cells(r, 1).Text, 1, 3) Set k = .FindNext(k) Loop While Not k Is Nothing And k.Address < firstAddress End If End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See John Walkenbach's site for one method:
http://www.j-walk.com/ss/excel/tips/tip47.htm -- Regards, Tom Ogilvy "CG Rosén" wrote in message ... Good Day Group, When using the below code to "fill" a ComboBox how to ensure that only unique text will be added. The text that is in Range ("A1:A1000") is of this type: 001 001 001 002 003 003 004 as a result I would like the combobox listtext to show 001 002 003 004 etc Brgds CG Rosén -------------------------------------------------------------------------- -------------------- With Worksheets("Sheet").Range("A1:A1000") Set k = .Find(nr, _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByColumns) If Not k Is Nothing Then firstAddress = k.Address Do r = k.Row Me.ComboBox1.AddItem Mid(Sheets("Sheet1").Cells(r, 1).Text, 1, 3) Set k = .FindNext(k) Loop While Not k Is Nothing And k.Address < firstAddress End If End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
additem to combobox with an array | Excel Discussion (Misc queries) | |||
combobox additem | Excel Programming | |||
AddItem Method - Combobox value | Excel Programming | |||
additem to a combobox from other excel worksheet | Excel Programming | |||
Multiple Column ComboBox using Additem | Excel Programming |