combo box - VBA form

  • Thread starter Thread starter Roy Gudgeon
  • Start date Start date
R

Roy Gudgeon

HI

I have created a form via VBA, I have included a combo box which I want to
point at a specific list of entries.

I can do this on a normal worksheet using data validation, how do I do it in
VBA design mode
 
Hi,

One way

Private Sub UserForm_Initialize()
For x = 1 To 6
ComboBox1.AddItem Worksheets("Sheet1").Cells(x, 1).Value
Next
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
Maybe neater

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "Sheet1!" & "$A$1:$A$6"
End Sub

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
Thanks Mike

Easy when you know how, appreciate prompt reply and solution.
Sure I'll be back, am still learning and I'm not a quick learner !
 
Back
Top