ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort Data in a combobox list (https://www.excelbanter.com/excel-programming/345791-sort-data-combobox-list.html)

Kryer

Sort Data in a combobox list
 
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


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com