I am trying to iterate through activex checkboxes. If the checkbox is checked, it needs to move the information from that line to a different sheet (sub COMPLETE) and then move the lines below up. I am getting a run-time error 1004 on the second time through at the Set cb. How can I fix this?
Private Sub cmbupdate_Click()
Dim i As Long
Dim cb As Object
i = 1
Do While i < 99
Set cb = ActiveSheet.OLEObjects("CheckBox" & i).Object
If cb.Value = True Then
Range("A" & (i + 3), "K" & (i + 3)).Select
Selection.Copy
COMPLETE
Selection.ClearContents
Range("A" & (i + 3)).Select
ActiveCell.Offset(1).Select
Orders.Range(Selection, Selection.Offset(, 10)).Select
Orders.Range(Selection, Selection.End(xlDown)).Select
Selection.Cut Range("A" & (i + 3))
Range("A5", "K101").Select
AddBorder
Range("A4").Select
cb.Value = False
i = i
Else
i = i + 1
End If
Loop
End Sub