J
Jag Man
I am trying to create a Worksheet from within a Sub procedure. I can create
a
command button ActiveX control with
ActiveWorkbook.Sheets.Add Type:=xlWorksheet
ActiveWorkbook.ActiveSheet.Name = "mixer"
ActiveWorkbook.ActiveSheet.OLEObjects.Add
ClassType:="Forms.CommandButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=140, Top:=30, _
Width:=100, Height:=40
ActiveWorkbook.ActiveSheet.OLEObjects("CommandButton1"). _
Object.Caption = "Calculate"
This automatically creates an associated Sub:
Private Sub CommandButton1_Click()
End Sub
Is there any way to then complete this "stub?" That is, I'd like to put in
its body "myFunction", programmatically,
so it becomes:
Private Sub CommandButton1_Click()
myFunct
End Sub
TIA
Ed
a
command button ActiveX control with
ActiveWorkbook.Sheets.Add Type:=xlWorksheet
ActiveWorkbook.ActiveSheet.Name = "mixer"
ActiveWorkbook.ActiveSheet.OLEObjects.Add
ClassType:="Forms.CommandButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=140, Top:=30, _
Width:=100, Height:=40
ActiveWorkbook.ActiveSheet.OLEObjects("CommandButton1"). _
Object.Caption = "Calculate"
This automatically creates an associated Sub:
Private Sub CommandButton1_Click()
End Sub
Is there any way to then complete this "stub?" That is, I'd like to put in
its body "myFunction", programmatically,
so it becomes:
Private Sub CommandButton1_Click()
myFunct
End Sub
TIA
Ed