Initializing Combobox in a Userform

  • Thread starter Thread starter Neal
  • Start date Start date
N

Neal

Dear Experts,

I have a combobox in a userform that I want to initialize
from a list of names that is on the sheet called "Stock".
What is the easiest way to do this? Thanks in advance.

Neal
 
This code reads the data from the sheet and initializes a combobox named
cboMake:-

Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Worksheets(1).Activate
Cells(1, 1).Select
Do
If IsEmpty(ActiveCell) = False Then
With cboMake
.AddItem ActiveCell
End With
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

End Sub
 
Thanks for the suggestion. I will try it.

Neal
-----Original Message-----
This code reads the data from the sheet and initializes a combobox named
cboMake:-

Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Worksheets(1).Activate
Cells(1, 1).Select
Do
If IsEmpty(ActiveCell) = False Then
With cboMake
.AddItem ActiveCell
End With
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

End Sub



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top