insert check box to a particular cell through vba macro

后端 未结 3 1461
没有蜡笔的小新
没有蜡笔的小新 2021-01-16 09:26

I would like to insert the check box in particular cell through macro. For example: On click of a command button i should be able to add the check box to A1 cel

3条回答
  •  悲&欢浪女
    2021-01-16 09:28

    You can use a For Each loop to add the check boxes.

    Dim i as Integer
    Dim cel As Range
    i = 10
    For Each cel In Sheets("Pipeline Products").Range("O" & i & ":AG" & i)
        ActiveSheet.OLEObjects.Add "Forms.CheckBox.1", Left:=cel.Left, Top:=cel.Top, Width:=cel.Width, Height:=cel.Height
    Next
    

    Hope this helps.

提交回复
热议问题