Name of Combo box?

Posted on 2011-04-20
Last Modified: 2012-05-11
I have a sheet with 2 combo boxes (Form Control, not ActiveX).  I have found VBA code that will let me reset them to a specific entry. The code needs the names of the boxes.
 But how do I find the names of the boxes? Or how do I name them?  The Format Contol panel has no naming function.
Question by:IBMJunkman
    LVL 81

    Expert Comment

    by:zorvek (Kevin Jones)
    When a shape such as a Forms control is added to a worksheet, Excel gives it an arbitrary name such as "Picture 1". The numeric part of the name changes during the life of the worksheet - it is incremented with each new shape added regardless of which previously created shapes may have been deleted.

    To name a shape, select the shape and type the name in the Name Box located in the extreme left side of the Formula bar. Press ENTER to accept the name.


    Author Comment

    Well, I got them named.  But the code does not work.  I want the list to display with the 2nd entry showing.

    Selection.ListIndex = 2

    Perhaps this code is not correct?
    LVL 81

    Accepted Solution

    Sheets("PaceMCPDT").Shapes("WS").OLEFormat.Object.ListIndex = 2


    Author Closing Comment

    Worked perfectly.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Excel file corrupted. 13 29
    Excel Max 6 24
    Excel 2016 - What is this arrow pointing to a cell? 9 45
    rank minimum order 9 17
    What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    729 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

    19 Experts available now in Live!

    Get 1:1 Help Now