Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-23-2018, 02:20 PM
NoSparks NoSparks is offline Fill userform, combobox and frame based on data from multiple worksheets Windows 7 64bit Fill userform, combobox and frame based on data from multiple worksheets Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Had no idea how to alpha sort the dictionary keys.
My buddy 'Google' lead me to this which seems to do the trick.

Replace
Code:
'populate combobox
cboFYList.List = Application.Transpose(dic.keys)
with
Code:
  ' Sort The Unique Values
    Uniques = dic.keys
    With CreateObject("System.Collections.ArrayList")
        For X = LBound(Uniques) To UBound(Uniques)
            .Add Uniques(X)
        Next
        .Sort
        Sorted = .ToArray
    End With
  
  ' Populate Combo with Sorted Uniques
  cboFYList.List = Sorted
You'll also need to declare the additional variables near the beginning along with the other Dim statements
Code:
Dim X As Integer, Uniques As Variant, Sorted As Variant
Reply With Quote
 

Tags
combobox, frame, userform



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill userform, combobox and frame based on data from multiple worksheets Summing data from multiple worksheets in a workbook and placing into another worksheet safrac Excel 17 10-04-2022 12:21 PM
Merging 2 different cells containing IF formula & change in cell values based on multiple time frame jay_excel Excel 0 07-29-2017 11:04 PM
Excel to Word data import based on UserForm entry jhancock1994 Word VBA 8 05-16-2017 04:41 PM
Fill userform, combobox and frame based on data from multiple worksheets Using combobox to pass data from an Excel spread sheet to text boxes on userform Stewie840 Word VBA 14 12-17-2015 10:13 PM
Fill userform, combobox and frame based on data from multiple worksheets Conditional color fill based on presence of data avanderh Excel 11 07-28-2011 09:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft