
Originally Posted by
davesexcel
Hi Bruce,
Very impressive,
how can you set the range for the button, say next to the active cell??
I know it's 8 years too late but in case other users are looking for the same answer:
Dim sShape As Shape
With Range("A1")
Set sShape = ActiveSheet.Shapes.AddFormControl _
(Type:=xlButtonControl, Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
End With
With sShape
.OnAction = "YOURMACROHERE"
With .TextFrame.Characters
.Caption = "BUTTON TEXT"
With .Font
.name = "Arial"
.FontStyle = "Regular"
.Size = 12
End With
End With
End With
Bookmarks