I have a simple code like below, then I assigned to a shape e.g. Rounded Rectangle1 with text inside it RunMe
,
Sub Caller_Text()
MsgBox Application.Caller
End Sub
I need instead of the shape name to get the text on that shape I just used to execute the macro,
In advance, grateful for any useful comment and answer.
CodePudding user response:
Adapt this as required:
ButtonName = Application.Caller
Set MyShape = ActiveSheet.Shapes(ButtonName)
MyString = ActiveSheet.Shapes(MyShape.Name).TextFrame.Characters.Text