• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Optional Button activeX

Kodosak

New Member
Hi Guys,

I would like to create VBA code for : Add optional button activeX to column range K1:K15 which will be linked to cell in column A1:A15. Caption for buttons should be Select Employee
My skill in VBA is low.
I try something but not working
It can be done manualy but i will need add option button for bigger range in future.
Could you help me pls.

Code:
Sub AddOptionButton()
    With ActiveSheet.OLEObjects.Add(ClassType:="Forms.OptionButton.1", Left:=784, Top:=170, _
                                    Width:=108, Height:=17)
        .Name = "NewOptionButton"
        .Object.Caption = "Select Employee"
    End With
End Sub

Sub LinkOptionalButton()
    ActiveSheet.OLEObjects("NewOptionButton").LinkedCell = "Birthday List CE!$A$1"
End Sub

60672

its urgent so i try next 2 forums :
https://www.excelforum.com/excel-pr...9309-optional-button-activex.html#post5136939
https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1219264-optional-button-activex
 
Last edited:
Back
Top