Hi, I'm having a little trouble initializing my combobox in excel VBA. Not sure why there are duplicate values for every combobox. Each box displays the items I have added multiple times (ex. MC says 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5).
Also, my dates column, E, has several of the same date. Thus, my comboxbox date values are being repeated too.
Is there any way to display only unique values?
Thanks!
Here is my code
Also, my dates column, E, has several of the same date. Thus, my comboxbox date values are being repeated too.
Is there any way to display only unique values?
Thanks!
Here is my code
Code:
Private Sub UserForm_Click()
With Me.Shift
.AddItem "A"
.AddItem "B"
.AddItem "A & B"
End With
With Me.MC
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
End With
With Me.GraphType
.AddItem "Bar"
.AddItem "Line"
.AddItem "Pie"
End With
With Me.InitialDate
With Worksheets("Calculation")
InitialDate.List = .Range("E2:E" & .Range("E" & .Rows.Count).End(xlUp).Row).Value
End With
End With
With Me.FinalDate
With Worksheets("Calculation")
FinalDate.List = .Range("E2:E" & .Range("E" & .Rows.Count).End(xlUp).Row).Value
End With
End With
End Sub