Excel dropdown list choice used in a formula

Posted on 2012-08-13
Last Modified: 2012-08-23
Using Excel 2007.  Want to use a combobox on a worksheet for users to choose a month (January, etc.).  Their choice should be stored as a text variable "January" for use in an existing formula in the same worksheet.  The formula should execute when they make their choice from the list.  Can someone help me construct the solution using VBA?  I'm a newbie with VBA.

Thank you, experts!
Question by:DetersLaw
    LVL 50

    Accepted Solution

    any particular reason you want to do this with VBA and a combo box? You could use Data Validation instead with a list of the 12 month names.

    See attached.

    cheers, teylyn

    Author Comment

    That works nicely, Teylyn.

    But I'm afraid the workgroup who will be using this workbook have changed how they want this to work:  They want to rename a worksheet to the name of a month and use the updated name in this formula, which is on a different worksheet in the same workbook.


    Said another way.  When they change then name of the July worksheet to August, the formula should change along with it.

    Thanks, and apologies for changing the requirements.  I am open to a variety of methods.
    LVL 50

    Expert Comment

    If a formula refers to a cell in another sheet and the sheet gets renamed, the formula will reflect the new sheet name.

    If that is not working for you, please post a file with some examples.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now