Name of Combo box?

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.
IBMJunkmanAsked:
Who is Participating?
 
zorvek (Kevin Jones)ConsultantCommented:
Sheets("PaceMCPDT").Shapes("WS").OLEFormat.Object.ListIndex = 2

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
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.

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

Sheets("PaceMCPDT").Shapes("WS").Select
Selection.ListIndex = 2

Perhaps this code is not correct?
0
 
IBMJunkmanAuthor Commented:
Worked perfectly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.