pabharathi2005
New Member
- Joined
- Sep 10, 2015
- Messages
- 5
Hi All,
I am trying to create a spreadsheet software to create fixtures for different games as a part of a project. I have this need to be able to create a command button and the code for this to execute this is in Modules > CommandButton1_Click(). I am able to add the button but not add the code to it. It is a lengthy code. Can anyone help me with this? The code I used to add the button is as follows:
Sub Create_Command_Button()
Dim oOLE As OLEObject
Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Left:=723, Top:=16.5, Height:=44.25, Width:=94.5)
oOLE.Interior.Color = vbRed
oOLE.Placement = 2
oOLE.Object.Caption = "Make Fixtures"
oOLE.Object.******* = Module1.CommandButton1_Click()
End Sub
Any help is appreciated.
I am trying to create a spreadsheet software to create fixtures for different games as a part of a project. I have this need to be able to create a command button and the code for this to execute this is in Modules > CommandButton1_Click(). I am able to add the button but not add the code to it. It is a lengthy code. Can anyone help me with this? The code I used to add the button is as follows:
Sub Create_Command_Button()
Dim oOLE As OLEObject
Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Left:=723, Top:=16.5, Height:=44.25, Width:=94.5)
oOLE.Interior.Color = vbRed
oOLE.Placement = 2
oOLE.Object.Caption = "Make Fixtures"
oOLE.Object.******* = Module1.CommandButton1_Click()
End Sub
Any help is appreciated.