LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sorting/no duplicate scripting dictionary in Excel VBA

John Walkenbach shows how to sort elements of a collection. Maybe you could
modify it for your dictionary object.

http://j-walk.com/ss/excel/tips/tip47.htm

ps. rSource is gonna be a big range. You may want to limit it to something
smaller.

with worksheets("master interview schedule")
set rSource = .range("a1",.cells(.rows.count,"A").end(xlup))
end with



wrote:

How to sort the Combobox values from the scripting dicionary?

The following code works well when posting values in the combobox and
eliminating the dups:

Dim rSource As Range, cell As Range
Dim sVal As String

'Set rng = curWks.AutoFilter.Range
Set rSource = Worksheets("Master Interview Schedule").Range("A:A")
With ComboBox1
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

Is there a way to sort the values at the same time?


--

Dave Peterson
 
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
Collection VS Scripting.Dictionary Tetsuya Oguma Excel Programming 1 October 16th 06 09:49 AM
Scripting.Dictionary question Jennifer Excel Programming 6 October 12th 06 07:30 PM
Scripting.Dictionary Jennifer Excel Programming 2 October 12th 06 12:03 PM
VBA - running scripting dictionary (error!) ajliaks[_13_] Excel Programming 4 April 18th 04 10:13 PM
VBA question - Set reference to run Scripting.Dictionary ajliaks[_12_] Excel Programming 2 April 17th 04 03:47 PM


All times are GMT +1. The time now is 09:42 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"