Jun 1, 2011

Return the selected Value from a Shape object

I have searched hundred of sites and finally got the clue to this solution.

suppose you have a Shape object named dropdownLocation


Sub GetSelectedValue()

' get the selected index
Range("D2").Value = Sheets("Sheet2").Shapes("dropdownKeyTopic").ControlFormat.Value

' get the selected value
Range("D2").Value = Sheets("Sheet2").Shapes("dropdownLocation").ControlFormat.List(Sheets("Sheet2").Shapes("dropdownLocation").ControlFormat.Value)

End Sub

No comments: