View Single Post
  #2   Report Post  
Greg Maxey
 
Posts: n/a
Default

Don,

Yes it can by using macros. I am a novice with VBA and rusty to boot, but
here is an example of code to tally the results of check boxes in columns 2,
3, 4, and 5 (I used labels b, c, d, e) of a table that might get you
started. You will need to insert text fields in the last row of the columns
bookmarked as indicated in the code to hold the results.

If you have further problems you might want to post in the VBA beginner or
general group where the heavies hang out.

Sub TallyResults()

Dim bTotal As Integer, cTotal As Integer, dTotal As Integer, eTotal As
Integer

bTotal = 0
cTotal = 0
dTotal = 0
eTotal = 0

For i = 1 To ActiveDocument.Tables(1).Rows.Count
On Error Resume Next
bTotal = bTotal - ActiveDocument.Tables(1).Cell(i,
2).Range.FormFields(1).CheckBox.Value
cTotal = cTotal - ActiveDocument.Tables(1).Cell(i,
3).Range.FormFields(1).CheckBox.Value
dTotal = dTotal - ActiveDocument.Tables(1).Cell(i,
4).Range.FormFields(1).CheckBox.Value
eTotal = eTotal - ActiveDocument.Tables(1).Cell(i,
5).Range.FormFields(1).CheckBox.Value

Next i
ActiveDocument.FormFields("bTotal").Result = bTotal
ActiveDocument.FormFields("cTotal").Result = cTotal
ActiveDocument.FormFields("dTotal").Result = dTotal
ActiveDocument.FormFields("eTotal").Result = eTotal

End Sub


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

Don wrote:
I have a several columns of check boxes in a table and would like to
total the number of "True" boxes for each column. Can this be done?