View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Assign macros to dynamically created form elements

One way:

Public Sub Macro1()
ActiveSheet.Shapes("Button 1").OnAction = "MyMacro"
End Sub


In article ,
(Joepy) wrote:

Hello,

I have a form where all elements (dropdowns, checkboxes, etc.) are
created dynamically from the values of an excel sheet.

How can I assign a macro to a form element? When the form element is
actually drawn in the VBA editor, I can use a "Private Sub
btn_Info_Click()", but this is obvoiusly not possibe in this case.

Does anyone knwo a solution?

Regards,
Joepy