sum of letters in a colum

T

tony

I have the task of converting a number of excel documents
to word (basically because my boss likes the way word
looks... besides hes a moron... anyway)

my first problem comes with a checklist. in the excel
file i used the formula "=COUNTIF(C7:C20,"N")" to count
the number of N's that were put in the NO colum.. (there
are 3 colums "Y" for yes, "?" for undecided, and "N" for
no.) This formula will not work in the word table.
This table spans about 3 pages. I have tried the =count
but this will only count the fields if there are numeric
charecters in the fields.

can this be done? or have i just forgot some silly
punctuation....

thanks,

tony
 
S

Suzanne S. Barnhill

Can't be done in Word. That's what Excel is for. You can insert an Excel
sheet in a Word doc.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

If i were to change all of the y and n fields to check
boxes. would i be able to make it count the check boxes?
 
G

Greg Maxey

I like it,

Yes. Well until someone comes along that knows more about it than I do, at
least very crudely. Follows is a macro that if you are willing to put the
time in to construct will work.
You will have to bookmark each yes checkbox Yes1, Yes2, etc. No and Maybe
in a like manner. At the bottom of each list insert a text field (text1,
text2, text3). Set the macro to run on exit from each check box.

I say this is crude because there could be a way to write it say:

For each Yes check box to Yes Checkbox Count ...
but I don't know how to do this if it can be done. You might try posting
this mess in the VBA Beginners group and see if someone can help you refine
it.

Good luck.

Sub Countboxes()

Dim Yes As Long
Dim No As Long
Dim Maybe As Long
With ActiveDocument
If .FormFields("Yes1").Result = True Then
Yes = Yes + 1
End If
If .FormFields("Yes2").Result = True Then
Yes = Yes + 1
End If
'Repeat adding the above If string for each Yes checkbox.
If .FormFields("No1").Result = True Then
No = No + 1
End If
If .FormFields("No2").Result = True Then
No = No + 1
End If
If .FormFields("Maybe1").Result = True Then
Maybe = Maybe + 1
End If
If .FormFields("Maybe2").Result = True Then
Maybe = Maybe + 1
End If
ActiveDocument.FormFields("Text1").Result = Yes
ActiveDocument.FormFields("Text2").Result = No
ActiveDocument.FormFields("Text3").Result = Maybe

End With
End Sub

--
\\\\///////////
( @ @ )
----oo00---(_)---00oo----
Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top