Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thoriqmacto/d4fc5c4a6d09d7e6697a to your computer and use it in GitHub Desktop.
Save thoriqmacto/d4fc5c4a6d09d7e6697a to your computer and use it in GitHub Desktop.
This routine will print checkbox object to the worksheet and dynamically assigned name to each of it.
Sub printCbox()
Dim i As Integer
Dim jmlhCSN As Integer
Dim left, topp As Double
Dim width, height As Double
jmlhCSN = 16
For i = 1 To jmlhCSN
left = 10 'Cells(i,"A")
topp = Cells(i + 2, "A").top
width = 8 'Cells(i + 2, "A").width
height = Cells(i + 2, "A").height
ActiveSheet.CheckBoxes.Add(left, topp, width, height).Select
With Selection
.Caption = ""
.Value = xlOff
.LinkedCell = "AA" & i + 2
.Display3DShading = False
End With
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment