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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
adding up column of Xs
Using Word 2000 I have a table that has X's to designate a true statement. Is
there a way to have a formula add up the Xs and give me a numeric total? Thank You, ERI Lady |
#2
|
|||
|
|||
If you run the following macro it will insert the number of X's in the
second column of the table in the last cell in that column: Dim i As Long, Result As Long, Check As Range Result = 0 For i = 1 To ActiveDocument.Tables(1).Rows.Count - 1 Set Check = ActiveDocument.Tables(1).Cell(i, 2).Range Check.End = Check.End - 1 If Check = "X" Then Result = Result + 1 Next i ActiveDocument.Tables(1).Cell(i, 2).Range.InsertBefore Result -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "ERI Lady" wrote in message ... Using Word 2000 I have a table that has X's to designate a true statement. Is there a way to have a formula add up the Xs and give me a numeric total? Thank You, ERI Lady |
#3
|
|||
|
|||
Thank you Doug for your response. Unfortunately I'm not skilled enough in
WORD to play with Macros. I went to the Tools menu, clicked on Macro, create, and was instantly transported to a world I've never seen before. So I muddled through and got the macro created (so I thought) and when I went back to the document, tools, macros, chose the macro I'd written, and clicked on run this is the error message I got: "The requested member of the collection does not exist." It didn't work. Do you have any easier way to do this? Peace Yvonne "Doug Robbins" wrote: If you run the following macro it will insert the number of X's in the second column of the table in the last cell in that column: Dim i As Long, Result As Long, Check As Range Result = 0 For i = 1 To ActiveDocument.Tables(1).Rows.Count - 1 Set Check = ActiveDocument.Tables(1).Cell(i, 2).Range Check.End = Check.End - 1 If Check = "X" Then Result = Result + 1 Next i ActiveDocument.Tables(1).Cell(i, 2).Range.InsertBefore Result -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "ERI Lady" wrote in message ... Using Word 2000 I have a table that has X's to designate a true statement. Is there a way to have a formula add up the Xs and give me a numeric total? Thank You, ERI Lady |
#4
|
|||
|
|||
See http://www.gmayor.com/installing_macro.htm
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "ERI Lady" wrote in message ... Thank you Doug for your response. Unfortunately I'm not skilled enough in WORD to play with Macros. I went to the Tools menu, clicked on Macro, create, and was instantly transported to a world I've never seen before. So I muddled through and got the macro created (so I thought) and when I went back to the document, tools, macros, chose the macro I'd written, and clicked on run this is the error message I got: "The requested member of the collection does not exist." It didn't work. Do you have any easier way to do this? Peace Yvonne "Doug Robbins" wrote: If you run the following macro it will insert the number of X's in the second column of the table in the last cell in that column: Dim i As Long, Result As Long, Check As Range Result = 0 For i = 1 To ActiveDocument.Tables(1).Rows.Count - 1 Set Check = ActiveDocument.Tables(1).Cell(i, 2).Range Check.End = Check.End - 1 If Check = "X" Then Result = Result + 1 Next i ActiveDocument.Tables(1).Cell(i, 2).Range.InsertBefore Result -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "ERI Lady" wrote in message ... Using Word 2000 I have a table that has X's to designate a true statement. Is there a way to have a formula add up the Xs and give me a numeric total? Thank You, ERI Lady |
#5
|
|||
|
|||
Suzanne:
thank you so much for the link and the instructions. Unfortunately after creating the macro I still received the same error message as previously. I believe it has to do with the design of the table. It contains merged cells and split cells. I'm not sure that WORD can can work with those specifics. This is the line that the debugger says is incorrect: Set Check = ActiveDocument.Tables(1).Cell(i, 2).Range I inserted a new independent table at the end of the document and tried to run the macro on it but got the same error message. I want to thank you both for your help so far and I'm at the point that I'm going to tell the Exec. that I'll just have to hand count it or he'll have to learn how to use EXCEL. Peace Yvonne "Suzanne S. Barnhill" wrote: See http://www.gmayor.com/installing_macro.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "ERI Lady" wrote in message ... Thank you Doug for your response. Unfortunately I'm not skilled enough in WORD to play with Macros. I went to the Tools menu, clicked on Macro, create, and was instantly transported to a world I've never seen before. So I muddled through and got the macro created (so I thought) and when I went back to the document, tools, macros, chose the macro I'd written, and clicked on run this is the error message I got: "The requested member of the collection does not exist." It didn't work. Do you have any easier way to do this? Peace Yvonne "Doug Robbins" wrote: If you run the following macro it will insert the number of X's in the second column of the table in the last cell in that column: Dim i As Long, Result As Long, Check As Range Result = 0 For i = 1 To ActiveDocument.Tables(1).Rows.Count - 1 Set Check = ActiveDocument.Tables(1).Cell(i, 2).Range Check.End = Check.End - 1 If Check = "X" Then Result = Result + 1 Next i ActiveDocument.Tables(1).Cell(i, 2).Range.InsertBefore Result -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "ERI Lady" wrote in message ... Using Word 2000 I have a table that has X's to designate a true statement. Is there a way to have a formula add up the Xs and give me a numeric total? Thank You, ERI Lady |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Q: adding a column to a query | Geoff Jones | New Users | 1 | August 26th, 2004 12:21 AM |
Adding a column of numbers | Peter Jay Salzman | General Discussion | 2 | June 5th, 2004 01:49 AM |
Adding a column of numbers | Worksheet Functions | 3 | April 27th, 2004 05:36 PM | |
Adding up a column of minutes & seconds | ann-marie | Worksheet Functions | 1 | September 30th, 2003 08:55 AM |