Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-21-2015, 07:27 AM
gmaxey gmaxey is offline count selected checkboxes in each group Windows 7 32bit count selected checkboxes in each group Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If your structure is consistent (6 checks for each question) then the following should work. You will have to use a naming convention like "grp1Chk1, grp1Chk2, etc. and name the group totals grp1Tally, grp2Tally etc.

Code:
Sub TallyTicks()
'A basic Word macro coded by Greg Maxey
Dim lngGroup As Long
Dim lngIndex As Long
Dim lngTally As Long
  lngGroup = Mid(Selection.FormFields(1).Name, 4, 1)
  For lngIndex = 1 To 3
    If ActiveDocument.FormFields("grp" & lngGroup & "Chk" & lngIndex).CheckBox.Value = True Then
      lngTally = lngTally + 1
    End If
  Next lngIndex
  ActiveDocument.FormFields("grp" & lngGroup & "Tally").Result = CStr(lngTally)
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
checkbox, checked boxes, count multiple



Similar Threads
Thread Thread Starter Forum Replies Last Post
Group Table Rows/Column (like Excel Group) eoinymc Word 1 03-11-2014 04:51 AM
count selected checkboxes in each group checkboxes smohap Word 1 06-19-2011 09:24 PM
count selected checkboxes in each group Excel Checkboxes theresamille699 Excel 3 04-12-2011 08:08 PM
Ticking Checkboxes screid Word 1 06-08-2010 02:04 AM
Manipulating checkboxes in XML Ivo Word 0 12-06-2005 09:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft