Using Checkboxes to Populate Table

Microsoft Office excel 2007 home & stude...
July 28, 2010 at 08:43:28
Specs: Windows XP
I am trying to create a cover page in excel that populates with data when specific checkboxes are checked. I am having trouble linking the checkboxes to the data, and don't know what do to.

For example, if my first checkbox was for "apparel" then I wanted to have all apparel related data show up on the cover page (data lives on another worksheet).

I've manage to create the checkboxes and link them to the cell, but I can't figure out how to apply any other code to filter the data!

Please help!

See More: Using Checkboxes to Populate Table

Report •

July 28, 2010 at 13:34:39
I don't use CheckBoxes for anything, but I played around a bit. Maybe someone else will come up with a more efficient way to do this...

I created 2 Named Ranges on Sheet2, "Apparel" and "Shoes", and put some values in them.

I placed 2 CheckBoxes on Sheet1. I did not link them to a cell.

I placed the following code into the Sheet1 module.

When I click CheckBox1, the Apparel table is copied to Sheet1 starting in A1 and CheckBox2 is cleared.

When I click CheckBox2, the Shoe table is copied to Sheet1 starting in A1 and CheckBox1 is cleared.

Hope this helps...

Private Sub CheckBox1_Click()
    If CheckBox1.Value = True Then
     Sheets(2).Range("Apparel").Copy Destination:=Range("A1")
     CheckBox2.Value = False
    End If
End Sub

Private Sub CheckBox2_Click()
    If CheckBox2.Value = True Then
     Sheets(2).Range("Shoes").Copy Destination:=Range("A1")
     CheckBox1.Value = False
    End If
End Sub

Report •
Related Solutions

Ask Question