G
Greg
Hi,
I am applying some of my limited skills to create a macro
that will tally checkboxes in a Table column. The
following is working good. I became interested in the line
Sub TallyColumnOfCheckboxes()
Dim cTotal As Integer, i As Integer
cTotal = 0
For i = 1 To ActiveDocument.Tables(1).Rows.Count
On Error Resume Next
cTotal = cTotal - ActiveDocument.Tables(1).Cell _
(i,1).Range.FormFields(1).CheckBox.Value
On Error GoTo 0
Next i
ActiveDocument.FormFields("Total").Result = cTotal
End Sub
I became interested in the line:
(i,1).Range.FormFields(1).CheckBox.Value
and was wondering how would I extend this macro to count
each checkbox in a cell if the cell contain multiple
checkboxes. I deduce that this would require
replacing .FormFields(1) with something like .FormFields
(j) creating a For j = to .... but I can't get my head
around it.
Ideas?
Thanks
I am applying some of my limited skills to create a macro
that will tally checkboxes in a Table column. The
following is working good. I became interested in the line
Sub TallyColumnOfCheckboxes()
Dim cTotal As Integer, i As Integer
cTotal = 0
For i = 1 To ActiveDocument.Tables(1).Rows.Count
On Error Resume Next
cTotal = cTotal - ActiveDocument.Tables(1).Cell _
(i,1).Range.FormFields(1).CheckBox.Value
On Error GoTo 0
Next i
ActiveDocument.FormFields("Total").Result = cTotal
End Sub
I became interested in the line:
(i,1).Range.FormFields(1).CheckBox.Value
and was wondering how would I extend this macro to count
each checkbox in a cell if the cell contain multiple
checkboxes. I deduce that this would require
replacing .FormFields(1) with something like .FormFields
(j) creating a For j = to .... but I can't get my head
around it.
Ideas?
Thanks