+ Reply to Thread
Results 1 to 4 of 4

How to add items in a combo box ?

  1. #1
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    How to add items in a combo box ?

    I thought this a simple task but I've been doing research and i cant find any help. My problem is very simple, I have a userform that has ComboBox1 in it and i want to add items like "Column C" , "Column D". I've actually prepared my Macro in a module and i dont know how to transfer these in a ComboBox. I thought it was as simple as the .Additem method but i cant seem to make it work. Here are my codes:

    Please Login or Register  to view this content.
    I want the combobox to have the options "Column J", "Column K", etc. up to "Column Q" and when the user selects it from the dropdown, its corresponding macro sets the range column for the UnitCostColumn variable. How can this be done?

  2. #2
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: How to add items in a combo box ?

    never mind solved it myself, hoho.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to add items in a combo box ?

    Hi, kjy1989,

    glad to hear but according to the Forum Rules you should point out how you did it (my guesses: using AddItem, a RowSource with cells with the column letters or a filled array):
    If you solve a problem yourself before anyone else has responded, post your solution to complete the thread.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: How to add items in a combo box ?

    Hi HaHoBe,

    I used the .Additem method. The reason why it wasnt working is because i wrote the code inside the combobox, (combobox_change) and it should be written under Userform_Initialize.

    so in the userform_initialize my code went something like:

    Please Login or Register  to view this content.
    Thank you and I apologize if i overlooked that part of the forum rules.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Combo Box items
    By LiLi1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2010, 09:15 AM
  2. Listing Items in Combo Box
    By randheerp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2009, 01:58 AM
  3. How do I add items to a combo box?
    By MikeDean in forum Excel General
    Replies: 1
    Last Post: 02-15-2008, 05:00 PM
  4. items in combo box
    By vroemans in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-14-2007, 04:17 PM
  5. [SOLVED] add items to combo box
    By beauty_bobaloo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2006, 05:25 AM

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