Link to home
Start Free TrialLog in
Avatar of SEMCIT
SEMCIT

asked on

Get Form combobox macro name with code

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

Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Have you tried S.Name?

Kevin
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SEMCIT
SEMCIT

ASKER

Thank you very much for the quick response and perfect, simple solution.