0

I got a small problem, I'm adding items to my combobox in my userform but they don't show up in the combobox when I execute the code...

I'm trying the following code

Private Sub period_input_Change()

With period_input

.AddItem "Apple"
.AddItem "Sugar"

End With
End Sub

Also tried this one

Private Sub box_action()

With Sheets(1).period_input
    .AddItem "hello"
    .AddItem "mongoasd"
End With

End Sub

It simply shows up as an empty column ( no string is there ). Anyone knows the issue?

1 Answer 1

1

You probably want to add the items during the initialization phase of the form:

Private Sub UserForm_Initialize()
    With Me.period_input
        .AddItem "hello"
        .AddItem "mongoasd"
    End With
End Sub

Otherwise, I see no problem with the code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.