fill Combo box data acroding to text box data entry.
Hi All,
Can you please explain me how can i fill data in a combo box according to entry done in a text box.
example i have data with several entries like:
1201 RED 1201_RED
1201 RED 1201_RED
1201 BLUE 1201_BLUE
1201 BLUE 1201_BLUE
1202 VERT 1202_VERT
1202 VERT 1202_VERT
1203 yellow 1203_yellow
1203 yellow 1203_yellow
what i need is if i type 1201 then only :
1201_RED
1201_BLUE
is display not all the colors and number.
Am actually using this code which is adding all the colors:
Set sRange = Range("C4", Range("C65536").End(xlUp))
FillCtrlUnique sRange, Me.cboPOSEdit
End Sub
Sub FillCtrlUnique(myRange As Range, myControl As Control)
Dim Coll As New Collection
Dim var As Variant
Dim cell As Range
On Error Resume Next
For Each cell In myRange
Coll.Add Item:=cell.Value, key:=CStr(cell.Value)
Next cell
On Error GoTo 0
With myControl
.Clear
For Each var In Coll
.AddItem var
Next var
End With
Set Coll = Nothing
End Sub[/vba]
Please find also a sample of my data attached.
Any help will be very helpful to me.
thanking in advance.
[vba]
Sub snb_002()
mycontrol.list = Filter([transpose(if(C1:C100="","~",if(countif(offset(C1,,,row(C1:C100)),C1:C100)=1 ,C1:C100,"~")))], "~", False)
end sub
many thanks for the help but i am not able to integrate the code. Can you please explain me where shall i integrate the code. is it on the text box change?