Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word Tables
Word Table Calculation VBA
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Doug Robbins - Word MVP, post: 5769187"] I can't tell exactly what you have, but if you have a table with check boxes in all columns except the last column and in the last column you have a textbox formfield (assumed to be given the bookmark names row1, row2, row 3, etc.) with data entry to those formfields not being enabled, and then you have a final row in the table in which you have a calculation type formfield that calculates the sum of the values of the other textbox formfields (=row1+row2+row3, etc) and you have the following macro run on exit from each of the checkbox formfields and you have the calculate on exit property for those formfields set, the textbox formfield at the end of each row will be updated with the column number of the checked box and the textbox formfield in the final row will be updated with the sum of the column numbers: Dim i As Long, j As Long, k As Long i = Selection.Information(wdEndOfRangeRowNumber) j = Selection.Information(wdEndOfRangeColumnNumber) With Selection.Tables(1).Rows(i) If .Cells(j).Range.FormFields(1).CheckBox.Value = True Then For k = 1 To .Cells.Count - 1 If k <> j Then .Cells(k).Range.FormFields(1).CheckBox.Value = False End If Next .Cells(.Cells.Count).Range.FormFields(1).result = j End If End With The user must tab out of the cells for this to work. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word Tables
Word Table Calculation VBA
Top