Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default counting checkboxes

Is it possible to count up the "true" values of a series of checkboxes? If
so, what is the formula?
--
Thanks,
Manny
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default counting checkboxes

The easiest way is to link the checkbox's to cells in your sheets. If the
checkboxes come from the control toolbox then add a reference to the
LinkedCell property (put the sheet in design mode and right click the
checkbox and select Properties). If the check boxes are from the forms
toolbar then right click the check box and select Format control | control.

Once you have linked each checkbox to a cell you can do a simple countif
function to get the number of checks...
--
HTH...

Jim Thomlinson


"Manny" wrote:

Is it possible to count up the "true" values of a series of checkboxes? If
so, what is the formula?
--
Thanks,
Manny

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default counting checkboxes

If you name your CheckBox'es so that they start with the same text
("CheckBox" for this example) and end in numbers of the same length (that
is, use leading zeroes if there are more than 9 CheckBox'es; that is, the
first 9 names should end with 01, 02, 03, etc. instead of just 1, 2, 3,
etc.), then this code will count the number of with check marks in them...

Dim X As Long
Dim Count As Long
Dim C As Control
For Each C In Me.Controls
If C.Name Like "CheckBox##" Then
If C.Value = True Then Count = Count + 1
End If
Next

Rick


"Manny" wrote in message
...
Is it possible to count up the "true" values of a series of checkboxes? If
so, what is the formula?
--
Thanks,
Manny


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default counting checkboxes

If the checkboxes were from the ControlToolbox and are on the Worksheet:

Sub chbx()
For i = 1 To 5
If Sheets(1).Shapes(i).Name = "CheckBox" & i Then
If Sheets(1).OLEObjects("CheckBox" & i).Object _
.Value = True Then
x = x + 1
End If
End If
Next
MsgBox x
End Sub

Somebody has already posted the code for other conditions..

"Manny" wrote:

Is it possible to count up the "true" values of a series of checkboxes? If
so, what is the formula?
--
Thanks,
Manny

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default counting checkboxes

I just wanted to say thanks to everyone for your help!!! It is surely
appreciated.

Manny
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting CheckBoxes scantor145[_17_] Excel Programming 1 July 25th 05 03:26 PM
Counting CheckBoxes on a Userform ExcelMonkey[_190_] Excel Programming 1 February 7th 05 12:54 PM
Counting Checkboxes Steven Excel Programming 5 May 17th 04 09:42 PM
Counting checkboxes with a true value Antje Crawford Excel Programming 2 November 7th 03 06:48 PM
Counting checkboxes Shamsul Excel Programming 1 August 11th 03 03:26 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"