如何在EXCEL SHEET中 动态添加控件
原文地址:http://blog.csdn.net/northwolves/archive/2005/11/07/524176.aspx
EXCEL SHEET中如何添加下拉框或者 文本框,命令按钮?下面的方法就可以:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myobj As OLEObject
Set myobj = Sheet1.OLEObjects.Add(ClassType:="Forms.commandbutton.1", Link:=False, DisplayAsIcon:=False, Left:=Target.Left, Top:=Target.Top, Width:=Target.Width, Height:=Target.Height)
myobj.Visible = True
myobj.Object.Caption = Target.Address
End