A
ajliaks
Hi,
Following your advice, I am trying this code, in order to show item
listed in combobox only once each item. (like autofilter), but i
doesn't work, (it gives mi error: Variable not defined and remarkin
"Scripting")
Private Sub UserForm_Initialize()
'Set a reference to MS Scripting runtime
Set Dic = CreateObject(Scripting.Dictionary)
Dim Dic As New Scripting.Dictionary
Dim rSource As Range, cell As Range
Dim sVal As String
Dim MyList As String
'Point to specific column
MyList = "P320"
Set rSource = Range("MyList")
With ChapExpCB
For Each cell In rSource.Cells
sVal = cell.Value
If Not Dic.Exists(sVal) Then
Dic.Add sVal, sVal
.AddItem sVal
End If
Next
End With
Set Dic = Nothing
End Sub
Thanks in advance
Following your advice, I am trying this code, in order to show item
listed in combobox only once each item. (like autofilter), but i
doesn't work, (it gives mi error: Variable not defined and remarkin
"Scripting")
Private Sub UserForm_Initialize()
'Set a reference to MS Scripting runtime
Set Dic = CreateObject(Scripting.Dictionary)
Dim Dic As New Scripting.Dictionary
Dim rSource As Range, cell As Range
Dim sVal As String
Dim MyList As String
'Point to specific column
MyList = "P320"
Set rSource = Range("MyList")
With ChapExpCB
For Each cell In rSource.Cells
sVal = cell.Value
If Not Dic.Exists(sVal) Then
Dic.Add sVal, sVal
.AddItem sVal
End If
Next
End With
Set Dic = Nothing
End Sub
Thanks in advance