Excel Tallying the total amount of checkboxes checked :: MrExcel Message Board
 Search   Memberlist   Usergroups   Favorites   Statistics   Register

 Tallying the total amount of checkboxes checked

Welcome to the Board

Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

How can I add checkboxes and get a total? I'm using checkbox under the forms toolbar. Is there another way to do this without using checkboxes? (i want the sheet to tally how many "yes" or "no" boxes are checked.)
Thanks!

Thu Jul 25, 2002 10:48 am

Andrew Poulsom
MrExcel MVP

Joined: 22 Jul 2002
Posts: 8059

Flag:

Status: Offline

Right click each check box and choose Format Control. Assign a cell link (different cells for each).

The cells will show TRUE if checked, FALSE if not.

Assuming you have 3 checkboxes linked to cells A1:A3 enter the following formula in cell A4:

=COUNTIF(A1:A3,"True")

Thu Jul 25, 2002 11:01 am

Welcome to the Board

Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

Thanks! That was killing me!

Mon Jul 29, 2002 1:28 pm

Dave Hawley
MrExcel MVP

Joined: 01 Mar 2002
Posts: 1575

Flag:

Status: Offline

You may find this alternative helpful

Have a Cell Ticked Upon Selection

This code must be placed in the Private Module of the Worksheet. To get there right click on the sheet name tab and select "View Code".

This code is an alternative to Checkboxes and can save a lot of space and is much easier to count the ticks! Just use the COUNTIF Function. This code works on only range A1:A10, but can be modified to suit. It could also be used in the Before Double Click event.

code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End Sub

Taken from: http://www.ozgrid.com/VBA/ExcelWorkbookEvents.htm

_________________
Dave
OzGrid.com Excel Experts |
Excel Add-ins | Templates & Calculators

Mon Jul 29, 2002 10:41 pm

Welcome to the Board

Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

Thanks a lot Dave. I think I'll try that, as it looks more streamlined.
-B

Tue Jul 30, 2002 3:00 pm
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Forum Jump:
 Jump to: Select a forum MrExcel Forums----------------Excel QuestionsInternational forumMicrosoft AccessTechnical issues and Future development Holy Macro! Books----------------Holy Macro! Products The Lounge----------------Max Cells Lounge Announcements----------------About This BoardHall of Fame WinnersTest Here

Page 1 of 1

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forum