Results 1 to 2 of 2

Thread: Using Array with ComboBox

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Using Array with ComboBox

    hi everyone,

    im trying to wite a program that fills both Combo Boxes and List boxes using data from an exsiting array. So basically the array content goes into the Combo Boxes and List boxes.

    this is how im currently doing it but i need to use an array instead that holds all the months in a year:


    With ComboBox1
    .AddItem "January"
    .AddItem "February"
    .AddItem "March"
    .AddItem "April"
    .AddItem "May"
    .AddItem "June"
    .AddItem "July"
    .AddItem "August"
    .AddItem "September"
    .AddItem "October"
    .AddItem "November"
    .AddItem "December"
    End With

    similar for ListBox

    Can anyone help?

    thanks

  2. #2
    Addicted Member
    Join Date
    Jan 2005
    Posts
    138

    Re: Using Array with ComboBox

    try this:

    Sub Test()
    Dim DaMonths as Variant

    DaMonths = Array ("jan","feb","mar")

    ComboBox1.List DaMonths

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width