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  

IF statement using checkboxes



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2004, 05:14 PM
Janice
external usenet poster
 
Posts: n/a
Default IF statement using checkboxes

Hello,
I have been creating forms using tables in a word
document and have used the check boxes also. What I have
been stumbling over is the same question you have but
something more simple. I would like to just add up the
check boxes in the column above. Did you resolve your
question and can you reply if you know the answer? I
can't seem to get any formula to work with the check
boxes. Please help is you know the answer. Thank you!
Janice

-----Original Message-----
I am trying to get a calculation in a field that if the
checkbox is checked calculate if not checked then leave
blank. My bookmark names for the two check boxes are
comptime and pay. They are both in the same table cell.

My
formula is {=IF(comptime) = "0" "" {IF(pay) = "0"
(g14+h14) \#"##0.00;(#,##0.00); ""}} The first and last
brackets are done with ctrl f9. I have tried multiply
combinations. If I do not use the check boxes and use a
different field then I can get it to work but not using
the boxes. Any help would be appreciated. If this is

not
a possible please notify. Thanks
.

  #2  
Old April 27th, 2004, 06:14 PM
mickey
external usenet poster
 
Posts: n/a
Default IF statement using checkboxes

You could do that in a macro but I do not know if possible
to do without. Sorry.
-----Original Message-----
Hello,
I have been creating forms using tables in a word
document and have used the check boxes also. What I have
been stumbling over is the same question you have but
something more simple. I would like to just add up the
check boxes in the column above. Did you resolve your
question and can you reply if you know the answer? I
can't seem to get any formula to work with the check
boxes. Please help is you know the answer. Thank you!
Janice

-----Original Message-----
I am trying to get a calculation in a field that if the
checkbox is checked calculate if not checked then leave
blank. My bookmark names for the two check boxes are
comptime and pay. They are both in the same table cell.

My
formula is {=IF(comptime) = "0" "" {IF(pay) = "0"
(g14+h14) \#"##0.00;(#,##0.00); ""}} The first and last
brackets are done with ctrl f9. I have tried multiply
combinations. If I do not use the check boxes and use a
different field then I can get it to work but not using
the boxes. Any help would be appreciated. If this is

not
a possible please notify. Thanks
.

.

  #3  
Old April 28th, 2004, 05:48 AM
Doug Robbins - Word MVP
external usenet poster
 
Posts: n/a
Default IF statement using checkboxes

Place a text formfield in the cell in which you want the result to be
displayed and change the name of the bookmark assigned to it to SumofChecks.
Then in the properties dialog for each of the checkboxes in the column set
an On Exit macro to run that contains the following code:

Dim i As Long, sumofchecks As Long
sumofchecks = 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
ActiveDocument.FormFields("SumofChecks").Result = sumofchecks

This assumes that there are check boxes in all rows but the last. If there
is no check box in the first row, change For i = 1 to For i = 2
--
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
...
Hello,
I have been creating forms using tables in a word
document and have used the check boxes also. What I have
been stumbling over is the same question you have but
something more simple. I would like to just add up the
check boxes in the column above. Did you resolve your
question and can you reply if you know the answer? I
can't seem to get any formula to work with the check
boxes. Please help is you know the answer. Thank you!
Janice

-----Original Message-----
I am trying to get a calculation in a field that if the
checkbox is checked calculate if not checked then leave
blank. My bookmark names for the two check boxes are
comptime and pay. They are both in the same table cell.

My
formula is {=IF(comptime) = "0" "" {IF(pay) = "0"
(g14+h14) \#"##0.00;(#,##0.00); ""}} The first and last
brackets are done with ctrl f9. I have tried multiply
combinations. If I do not use the check boxes and use a
different field then I can get it to work but not using
the boxes. Any help would be appreciated. If this is

not
a possible please notify. Thanks
.


 




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 12:01 AM.


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