sparkytech
Board Regular
- Joined
- Mar 6, 2018
- Messages
- 96
- Office Version
- 365
- 2019
I have a combobox that gets values autofilled and sorted from Column "A". Currently it looks at rows 15 to 80. How do I modify my code to search to the last row with data?
Code:
Dim myRange As Range
Set myRange = Sheets("Sheet1").Range("A15:A80")
With Sheets("Sheet1").Sort
.SortFields.Clear
.SortFields.Add myRange, xlSortOnValues, xlAscending
.SetRange myRange
.Apply
End With
Me.ComboBox1.List = myRange.value