Solved

Get Form combobox macro name with code

Posted on 2011-02-24
3
383 Views
Last Modified: 2012-06-21
Was wondering if there is a similar way (as below) or a different way to grab the "Macro name:" value of the macro assigned to an old Form combobox.  Thank you very much.

Had similar question with ID 26805164  where I was looking to grab the "Input range:" and "Cell link:" values of an old Form combobox.  That question was answered with the following code:

Sub GetProps()
    Dim S As Shape
    For Each S In ActiveSheet.Shapes
        If S.Type = msoFormControl Then
            If S.FormControlType = xlDropDown Then
                S.Select
                MsgBox Selection.Name & vbCrLf & Selection.ListFillRange & vbCrLf & Selection.LinkedCell
            End If
        End If
    Next
End Sub

0
Comment
Question by:SEMCIT
  • 2
3 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Have you tried S.Name?

Kevin
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
Comment Utility
Sorry, misread the question. Try:

   S.OnAction

Kevin
0
 

Author Closing Comment

by:SEMCIT
Comment Utility
Thank you very much for the quick response and perfect, simple solution.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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 will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 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

12 Experts available now in Live!

Get 1:1 Help Now