How to identify the clicked shape name in VBA

后端 未结 2 831
爱一瞬间的悲伤
爱一瞬间的悲伤 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
    

提交回复
热议问题