Hello everyone,
I have a decent understanding of vba but I'm stuck on a problem.
I have to generate checkbox on a sheet (sheet Result) depending on the value of a cell in another sheet (Sheet Data). So far it's a simple for loop on range.The checkbox are lined up in column A
I have to assign that value to the caption of the checkbox and add a value from another column of sheet Data along with the caption dynamically in a range further down in Sheet Result if I check the checkbox and remove it if I uncheck it.
[VBA]Sub AddCheckBoxes()
On Error Resume Next
Dim c As Range, myRange As Range
Set myRange = Range("DataJGO!A2:" & Range("DataJGO!A65536").End(xlUp).Address)
For Each c In myRange.Cells
If c.Offset(0, 28) <> "" Then
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width, c.Height).Select
End If
With Selection
.Characters.Text = c.Offset(0, 28).Value
.Name = "Chk" & c.Offset(0, 28).Value
End With
c.Select
Next
End Sub
[/VBA]
it's basically all the code I have for this part. From there I'm stuck, No clue where to begin. I beleive I will have to call a macro on click but still not sure how to assign it when I create them.
Any bits and pieces of code or advice will help, let me know if you need more info
Thank you for your time