View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jack jack is offline
external usenet poster
 
Posts: 186
Default Populate a combo box from a worksheet with VBA

I have a user form to enter data into an excel spreadsheet. I have a combo
box which needs to have 10 items in it, previously i have used the following -

With cboTrainer
.AddItem = "1"
.AddItem = "2"
.AddItem = "3"
.AddItem = "4"
.AddItem = "5"

Instead of this can i dynamically populate this list from data in my
spreadsheet, like this -

With cboTrainer
.AddItem = Trainers!B2

My syntax is not quite right, can anyone assist me?