How to identify the clicked shape name in VBA

后端 未结 2 830
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 21:13

I am trying to create an excel template where I have already assigned different macros to different shape that act as buttons. Now I am having problem of locating which one

相关标签:
2条回答
  • 2020-12-17 21:24

    You should be able to get the name of the clicked shape by using Application.Caller

    usage as shown

     CallingShapeName = ActiveSheet.Shapes(Application.Caller).Name 
    
     msgbox CallingShapeName
    
    0 讨论(0)
  • 2020-12-17 21:27
    ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text
    
    0 讨论(0)
提交回复
热议问题