No matter what, I can't figure out how to add a button via UDF.
Tried to call it through a another Function/Sub, doesn't matter as long as initial caller is a Function.
Any ideas how to solve it? Any suggestion would be greatly appreciated.
Sub AddButtonAt(r As Range)
With ActiveSheet.Buttons.Add(r.Left, r.Top, r.Width, r.Height)
.Name = "Btn" & r.Address
.caption = "B: " & r.Address
End With
End Sub
Function addB()
Call AddButtonAt(Selection)
End Function
Function addB() is just a helper. Ideally I'd use Function AddButtonAt(), if that would be possible.