Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

How to determine if an activex checkbox is checked?

$
0
0

I have 98 checkboxes embedded in my worksheet (Orders).

I want to select certain checkboxes then click a command button that will iterate through the checkboxes. If checked, I want to send the information in that line to the next blank line on another worksheet (Sub COMPLETE). Then I want to clear the information on that line and move the lines after that up a line.

When I step through the sub, I get:

error 1004 'Application-defined or object-defined error'

at the If statement.

Private Sub cmbupdate_Click()  
    Dim i As Long  

    For i = 1 To 98  
        If CheckBoxes("CheckBox"& i).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  
            CheckBoxes("Checkbox"& i).Value = False  
        End If  
    Next  
End Sub

Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>