mountainclimber11
Board Regular
- Joined
- Dec 1, 2009
- Messages
- 79
Hello. I'd like to create an ActiveX button in a sheet and assign a code to it (i.e. tell it to what sub to run and that sub already exists).
I can create the button: (recorded)
But I'd like to change the caption and assign a sub to it so when someone clicks the newly created activex button it runs a sub that already lives in a module within the workbook that the button is to be created. Everything happens and lives in ThisWorkbook.
Thanks!
PS - I cannot use a Command button....I can only use ActiveX
I can create the button: (recorded)
Code:
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=41395.5882352941, Top:=234.705882352941, _
Width:=119.117647058824, Height:=39.7058823529412).Select
But I'd like to change the caption and assign a sub to it so when someone clicks the newly created activex button it runs a sub that already lives in a module within the workbook that the button is to be created. Everything happens and lives in ThisWorkbook.
Thanks!
PS - I cannot use a Command button....I can only use ActiveX