I am adding several CommandButtons dynamically to my user form. To assign code, I used the answer of this question: Assign code to a button created dynamically
However, I need to determine which button has been clicked. They all do have different names. Therefore, my initial idea was to get the name of the clicked button in the
CmdEvents_Click() procedure. However, I have not found a solution how to do that.
Does anyone have a solution how to trigger button specific events?
- Add the
Nameof the new command e.g. like
ctl_Command.Name = "name_" & i
- Then in the