Hi,

I'm trying to set something up, so that every time a routine is called, it creates a new CommandButton and automatically creates a CommandButtonX_Click Sub with the same code. For example, the first time the button is clicked, it creates CommandButton9 and creates code like this:

Private Sub CommandButton9_Click()
Call MySub
End Sub

The next time it would create CommandButton10, etc.

Does anyone know if this is possible? If so, how would I do it?


Thanks,
Chris