Total checked option buttons in a word table?

  • Thread starter Thread starter Guest
  • Start date Start date
Hi =?Utf-8?B?c2NvdHQ=?=,
Can you add the total of checked option buttons in a word table?
You could probably use a macro. But you'd need to tell us what
needs to be totalled. The number of checkboxes checked? Values
associated with a checkbox? Also, which version of Word?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)
 
The version is 2000. I would need to calculate the number of boxes checked.

thanks
 
Hi =?Utf-8?B?c2NvdHQ=?=,

The following macro will add up the number of checked boxes in the first table
of a document and output the result in a message box

Sub CountCheckboxes()
Dim tbl As Word.Table
Dim ffld As Word.FormField
Dim lCheckedBoxes As Long

Set tbl = ActiveDocument.Tables(1)
lCheckedBoxes = 0
For Each ffld In tbl.Range.FormFields
If ffld.CheckBox.Valid Then
If ffld.CheckBox.Value = True Then
lCheckedBoxes = lCheckedBoxes + 1
End If
End If
Next
MsgBox lCheckedBoxes
End Sub

The version is 2000. I would need to calculate the number of boxes checked.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top