Hi Experts,
I have a Combobox1 in my Excel and I tried the code below yet error occur.
The error is Red Font
What I am trying to do from this code are ;
1. to display in my ComboBox1 a Unique values from my Worksheet("Oders") column A
2. Exclude Blanks in the display of Combobox1
Can anyone is kind to help me figure out fixing the error and the code to achieve my needs.
------------------
-----------------------------
Thanks in advance,
12Rev79
I have a Combobox1 in my Excel and I tried the code below yet error occur.
The error is Red Font
What I am trying to do from this code are ;
1. to display in my ComboBox1 a Unique values from my Worksheet("Oders") column A
2. Exclude Blanks in the display of Combobox1
Can anyone is kind to help me figure out fixing the error and the code to achieve my needs.
------------------
Rich (BB code):
Private Sub ComboBox1_Change()
Dim N, e
With Sheets("Orders").Range("A:A")
N = .Value
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For Each e In N
If Not .exists(e) Then .Add e, Nothing
Next
If .Count Then Me.ComboBox1.List = Application.Transpose(.keys)
End With
End Sub
Thanks in advance,
12Rev79
Last edited by a moderator: