D
Dylan
I have a combobox on my sheet and I populate it with day numbers 1-31. The
problem is the numbers appear repeated 31 times in the list.
My code is
Private Sub ComboBox1_DropButtonClick()
Dim myArray1 As Variant
Dim myArray2 As Variant
Dim i As Long
myArray1 = Split("0|1|2|3|4|5|6|" _
& "7|8|9|10|11|12|" _
& "13|14|15|16|17|18|" _
& "19|20|21|22|23|24|" _
& "25|26|27|28|29|30|" _
& "31", "|")
With lst01
Me.ComboBox1.ColumnCount = 1
Me.ComboBox1.ColumnWidths = "25"
End With
For i = 0 To UBound(myArray1)
Me.ComboBox1.AddItem
Me.ComboBox1.List(i, 0) = myArray1(i)
Next i
End Sub
problem is the numbers appear repeated 31 times in the list.
My code is
Private Sub ComboBox1_DropButtonClick()
Dim myArray1 As Variant
Dim myArray2 As Variant
Dim i As Long
myArray1 = Split("0|1|2|3|4|5|6|" _
& "7|8|9|10|11|12|" _
& "13|14|15|16|17|18|" _
& "19|20|21|22|23|24|" _
& "25|26|27|28|29|30|" _
& "31", "|")
With lst01
Me.ComboBox1.ColumnCount = 1
Me.ComboBox1.ColumnWidths = "25"
End With
For i = 0 To UBound(myArray1)
Me.ComboBox1.AddItem
Me.ComboBox1.List(i, 0) = myArray1(i)
Next i
End Sub