+ Reply to Thread
Results 1 to 6 of 6

ComboBox issues with Displaying AddItems

  1. #1
    Registered User
    Join Date
    07-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    ComboBox issues with Displaying AddItems

    So I have scrolled pages of suggestions for an answer to my dilemma, but have yet to come across a solution that works for my problem. I am very new to VBA and have little knowledge of coding in general, but moderate excel experience with functions, formulas, etc.

    Background - I'm trying to design a workbook for a company to easily be able to see the effects of Best, Expected, and Worst Case Revenue projections with the flexibility to adjust wages, purchases, etc. to be able to quickly plan for changes. In designing the workbook, I want to use a Combo box as a drop down on the home page to flip between Best, Expected, and Worst case scenarios. Ideally I'd like to link the drop down options to a second worksheet to directly pull in the monthly projections for each scenario, but a simple drop down selection that I can link to a cell on the home sheet can also work in conjunction with an IF statement.

    What I have thus far is -
    ComboBox with ActiveX

    Please Login or Register  to view this content.
    The Choose Scenario item I will zero out in the budget forcing a choice of the revenue projections, but when I save and re-open Excel the drop down box is empty. I looked at the fill range, but each item is in a separate location on sheet2. I would like to avoid creating a list in excel to preserve the print ability of the schedule.

    As I said, I can make due with a simple drop down box in conjunction with an IF statement, even though I'd ultimately like to learn the true programming side eventually.

    Thanks in advance for the help.
    Last edited by Cutter; 07-15-2012 at 04:56 PM. Reason: Added code tags

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: ComboBox issues with Displaying AddItems

    You'd be better off with a drop down in my opinion but if you must use an activex control I suggest you populate it from the Workbook_open event rather than the combobox's change event.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: ComboBox issues with Displaying AddItems

    I changed my my event to Workbook_Open as suggested, but the drop down box still appears empty on a restart.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,280

    Re: ComboBox issues with Displaying AddItems

    The Workbook_Open code must be in the ThisWorkbook module of your workbook.

  5. #5
    Registered User
    Join Date
    07-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: ComboBox issues with Displaying AddItems

    Thank you for the help, it worked.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: ComboBox issues with Displaying AddItems

    Hello dversion, and welcome to the forum.
    Firstly: Please notice that I have added code tags to your original post. The forum rules require them so please keep that in mind for your future threads. Thanks.

    Here's the rule:

    RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Secondly: Based on your last post I'll mark your thread as SOLVED. The forum rules also require this so please keep that in mind, also, for any future threads.

    Here's the method:

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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