LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - running scripting dictionary (error!)

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 = "P3:P20"
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

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Div/0 error on running mean % ferde Excel Discussion (Misc queries) 2 October 4th 08 02:40 AM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
VBA question - Set reference to run Scripting.Dictionary ajliaks[_12_] Excel Programming 2 April 17th 04 03:47 PM
Running from web error Ken[_14_] Excel Programming 0 September 11th 03 06:47 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"