View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default VBA - running scripting dictionary (error!)

shouldn't scripting.dictionary be a string: Set Dic = CreateObject("Scripting.Dictionary"


----- ajliaks wrote: ----

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 runtim

Set Dic = CreateObject(Scripting.Dictionary

Dim Dic As New Scripting.Dictionar
Dim rSource As Range, cell As Rang
Dim sVal As Strin
Dim MyList As Strin

'Point to specific colum
MyList = "P3:P20
Set rSource = Range("MyList"

With ChapExpC
For Each cell In rSource.Cell
sVal = cell.Valu
If Not Dic.Exists(sVal) The
Dic.Add sVal, sVa
.AddItem sVa
End I
Nex
End Wit
Set Dic = Nothin

End Su

Thanks in advance


--
Message posted from http://www.ExcelForum.com