I've been asked to generate a dynamic list of tasks dependent on selections from a form. Once the selections are made, the programming will generate a list that may be 5 rows or 15 rows long (or more or less). I've pieced together the following code to add checkboxes programmatically to my sheet in a specific range which works but I have some further criteria from the client. I'll make the range dynamic later.
TIA, rasinc
- Special Effect 3D
- Checkbox linked to the cell it is currently occupying
- If the last task list was 15 rows and the new one is 10 rows, the last 5 checkboxes should be deleted (this would be a different sub but all part of the programming needed
TIA, rasinc
VBA Code:
Dim rng As Range
Dim cel As Range
Set rng = Range("A15:A20")
Dim cb As CheckBox
For Each cel In rng
With Sheets("Event")
With .Shapes.AddFormControl(xlCheckBox, cel.left, cel.top - 1, 15, 15)
.TextFrame.Characters.Text = ""
[COLOR=rgb(209, 72, 65)]'cb.LinkedCell = cel.Address <<--link checkbox to cell it is in - error on identifying the checkbox cb.LinkedCell (Object variable or with block variabl not set)
' how do I identify the exact checkbox just added to assign a cell to it
'<<-- set 3D special effect[[/COLOR]
End With
End With
Next cel