Sort Data in a combobox list

K

Kryer

Private Sub UserForm_Initialize()
Dim sh As Worksheet
Dim rng As Range
Dim myval As Range
Dim myarray() As Variant

Range("C1").Select
Do Until ActiveCell = "GS"
Selection.End(xlDown).Select
Loop
Selection.Offset(1, 0).Select


Set sh = Workbooks("Book1.xls").Worksheets("Sheet1")
Set myval = Range(Selection, Selection.End(xlDown).Offset(1, 0))
Set rng = myval
myarray = rng
ComboBox1.List = myarray
End Sub

I am trying to figure out how to make this selection post a sorted ascending
list in the combobox on initialize. the combobox range varies in as many
listings as in names available. This could list from 100 - 200 names on any
given day and having to run thru this list unorganized is a nitemare. Any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top