A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add & Multiply Check boxes in a column.



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2004, 05:34 PM
Janice
external usenet poster
 
Posts: n/a
Default Add & Multiply Check boxes in a column.

I'm new in working with tables in a word document and
been beating my brains on calculating the check boxes in
a column. Seems simple but I have gotten a team of
people together to figure it out, but can't. I am
spending way too much time figuring this simple task out
and now seeking further help. In the form the user will
check the boxes that applies to the question. I would
like the form to add up the check boxes in that column
and multiply by the respected column number (like in a
comment form 1 - 5)for a total score at the bottom of
each column. Seems very simple but I can't make it to
work. Please help if you have done this before. Thank
you very much!
Aloha,
Janice
Ads
  #2  
Old April 28th, 2004, 06:13 AM
Doug Robbins - Word MVP
external usenet poster
 
Posts: n/a
Default Add & Multiply Check boxes in a column.

Assuming that the checkboxes are in rows 1 through n - 1 and columns 2
through 6, where n is the number of rows in the table and that in the cells
in columns 2 through 6 of the last row of the table, you have text type
formfields in which the result will be displayed, if you run the following
macro on exit from each of the checkbox formfields, it will do what you
want:

Dim i As Long, sumofchecks As Longsumofchecks = 0
For i = 1 To Selection.Tables(1).Rows.Count - 1
sumofchecks = sumofchecks -
Selection.Columns(1).Cells(i).Range.FormFields(1). CheckBox.Value
Next i
Selection.Columns(1).Cells(Selection.Tables(1).Row s.Count).Range.FormFields(
1).Result = sumofchecks * (Selection.Information(wdEndOfRangeColumnNumber) -
1)

If there are no checkboxes in the first row, change the second line to For i
= 2 etc..

You may also want to take a look at the article "Making groups of Check Box
Form Fields mutually exclusive (so
that they behave like radio buttons) " at:

http://word.mvps.org/FAQs/TblsFldsFm...FmFldChbxs.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"Janice" wrote in message
...
I'm new in working with tables in a word document and
been beating my brains on calculating the check boxes in
a column. Seems simple but I have gotten a team of
people together to figure it out, but can't. I am
spending way too much time figuring this simple task out
and now seeking further help. In the form the user will
check the boxes that applies to the question. I would
like the form to add up the check boxes in that column
and multiply by the respected column number (like in a
comment form 1 - 5)for a total score at the bottom of
each column. Seems very simple but I can't make it to
work. Please help if you have done this before. Thank
you very much!
Aloha,
Janice


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 OfficeFrustration.
The comments are property of their posters.