多莫西卡.
我想在工作表里创建一个按钮,按钮连接一段代码
怎么写ie呀
按钮我创建了,怎么衔接代码
Sub aa()
Dim cc As OLEObject
Dim aa As Worksheet
Set target = Cells(15, 7)
Set aa = sheet1
Set cc = aa.OLEObjects.Add(classtype:="forms.commandbutton.1", Left:=target.Top, Top:=target.Top)
cc.Name = "确认"
cc.Object.Caption = "确认2"
dd = aa.CodeName
End Sub
'Private Sub 确认()
Sub 确认()
UserForm1.Show
End Sub