Code:
Dim button As OLEObject
With ActiveCell
Set button = ActiveSheet.OLEObjects.Add _
(ClassType:="Forms.CommandButton.1", _
Link:=False, DisplayAsIcon:=False, _
Left:=.Left, _
Top:=.Top, _
Height:=.Height, _
Width:=.Width)
button.Object.Caption = .Row
button.Object.Font.Size = 6
button.FontStyle = "Bold"
button.Object.WordWrap = True
button.Name = "line" & .Row
End With
I also want to set the button property to be "don't move or size with cells", what should I do in vba?
Best regards,
lolo^^
Last edited: