Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
据我所知,在 Excel 中,我们可以将宏分配给几种对象:shape, Form Control, ActiveX Control...
shape
Form Control
ActiveX Control
给定一个 Excel 文件,我想编写一个 VBA 代码来执行以下操作:
我希望这是详尽无遗的,有人可以帮忙吗?
为位于ActiveSheet以下代码中的形状扩展@mehow 答案将导致形状名称和宏名称(如果有关联)。
ActiveSheet
Sub getShapeMacro() 'to secure for unexpected... On Error Resume Next Dim SHP As Shape For Each SHP In ActiveSheet.Shapes Debug.Print SHP.Name, SHP.OnAction Next End Sub