adding a routine/event to a control during execution
Hi to all,
I'm writing a macro in Excel, and just added a commandbutton to a form during its execution, but i'm not able to assign an execution code/routine to it! i've tryed the help on line and haven't found anything usefull, may you help me?
This is the code i wrote:
Private Sub UserForm_Initialize()
Dim CButton As Control
Dim X, Y
X=8
Y=16
Set CButton = frmDiametri_e_Spessori.Controls.Add("Forms.CommandButton.1")
CButton.Left = X
CButton.Top = Y
CButton.Caption = "OK"
End sub
Now i want to add some code to the CButton control so that, when clicked, it apply the changes i've done in the form
Thanks
Pierpaolo

