Hi based on link below I created a macro which is supposed to create checkboxes for every value from dynamic range. WHile running I got an compile error "incorrect use of ME keyword" . Can someone explain ?
thanks
http://stackoverflow.com/questions/...-based-on-cell-value?answertab=active#tab-top
thanks
http://stackoverflow.com/questions/...-based-on-cell-value?answertab=active#tab-top
Code:
Sub test()
Dim i As Integer
Dim cell As Range
Dim chkbox As MSForms.CheckBox
Dim x As Integer
i = Range("A1", Range("A1").End(xlDown)).Cells.Count
For x = 1 To i
Set chkbox = Me.Controls.Add("Forms.Checkbox.1", "Checkbox_" & x)
chkbox.Caption = Worksheets("List1").Cells(i, 1).Value
chkbox.Left = 5
chkbox.Top = 5 + ((i - 1) * 20)
Next x
End Sub