+ Reply to Thread
Results 1 to 6 of 6

Auto fill a UserForm ComboBox

  1. #1
    ZIXILPLIX
    Guest

    Auto fill a UserForm ComboBox

    I received the following code from a question I had earlier. It prefills ComboBox1 in a UserForm with numbers ranging from -3 to +3 and is defaulted to 0. Is there a way to make this code applicable to multiple ComboBoxes without copying it over and over and changing the number? Like maybe something like ComboBox1,3,6,11,14,23,65.AddItem "+3" and so forth? I know that doesn't work, I'm just trying to streamline.

    Please Login or Register  to view this content.
    Last edited by ZIXILPLIX; 05-02-2010 at 12:59 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Auto fill a UserForm ComboBox

    Hi ZIXILPLIX
    some thing like
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    ZIXILPLIX
    Guest

    Re: Auto fill a UserForm ComboBox

    Pike,
    Thanks a lot for your help on this, but I keep on getting the following error - Compile error: For Each control variable must be Variant or Object. Any idea what I am doing wrong?

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Auto fill a UserForm ComboBox

    ops ... i as a variant not a byte

  5. #5
    ZIXILPLIX
    Guest

    Re: Auto fill a UserForm ComboBox

    You are a genius!! Thanks a million!!

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Auto fill a UserForm ComboBox

    You say "a genius" most testify crazy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1