Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes in Excel...

Status
Not open for further replies.

tigger23

Programmer
Sep 19, 2001
10
US
Hi,I am making a spreadsheet and want to use the checkbox control. The sheet is to be sent to people, they then click the checkbox next to certain items on the sheet and return it. Once return the data needs to be analaysed, the checkbox column will be copied intoa master sheet, and the total number of checkboxes with ticks for each row needs to be calculated. I have tried using a control checkbox (but havent worked out what code to put behind it), and also a form checkbox, but i can't seem to work out the technical bit! PLEASE HELP ME!!cheers
tigger
 
Hi,
Are you using Forms or Control Toolbox? Skip,
metzgsk@voughtaircraft.com
 
Hi

If you are using the Control checkbox, you might want to try to link the CheckBox_Click() event to a particular cell in the worksheet.

Hope this will help

LSTAN
 
When you configure you CheckBox, (from Tool Box) set the Tag property to "Checkbox".

Then when you get back the workbook, run this code...
Code:
    Dim Boxes(), i
    i = 0
    For Each Shape In Shapes
        With Shape.DrawingObject.Object
            Select Case .DisplayStyle
                Case fmDisplayStyleCheckBox
                    If .Value Then
                        i = i + 1
                        ReDim Preserve Boxes(1 To i)
                        Boxes(i) = Shape.Name
                    End If
            End Select
        End With
    Next
    For i = 1 To UBound(Boxes, 1)
        MsgBox Boxes(i)
    Next
The for...next at the bottom just shows you what was selected.

Hope this helps :)
Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top