Excel Tallying the total amount of checkboxes checked :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Tallying the total amount of checkboxes checked
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Brad123
Welcome to the Board


Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

 Reply with quote  

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!
Brad

Post Thu Jul 25, 2002 10:48 am 
 View user's profile Send private message

Andrew Poulsom
MrExcel MVP


Joined: 22 Jul 2002
Posts: 8059

Flag: Uk

Status: Offline

 Reply with quote  

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")

Post Thu Jul 25, 2002 11:01 am 
 View user's profile Send private message

Brad123
Welcome to the Board


Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

 Reply with quote  

Thanks! That was killing me!

Post Mon Jul 29, 2002 1:28 pm 
 View user's profile Send private message

Dave Hawley
MrExcel MVP


Joined: 01 Mar 2002
Posts: 1575

Flag: Australia

Status: Offline

 Reply with quote  

Hi Brad

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

Post Mon Jul 29, 2002 10:41 pm 
 View user's profile Send private message Send e-mail Visit poster's website AIM Address

Brad123
Welcome to the Board


Joined: 25 Jul 2002
Posts: 3
Location: Earth

Status: Offline

 Reply with quote  

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

Post Tue Jul 30, 2002 3:00 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


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

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.