What is wrong with this IF statement?

B

BABs

In my document, I've entered in the following IF statement. I want it to
look at 3 cells (c2,c3,c4) in the excel sheet (sheet1) and if ANY of them are
true, insert the word "positive". If all 3 are false, it should insert
"negative" Right now, it always gives me "negative".
What have I done wrong?

{IF {LINK Excel.sheet.8 "my documents\\report info.xlsb"sheet1!r2c2} =
"TRUE" "positive" "{IF {LINK Excel.sheet.8 "my documents\\report
info.xlsb"sheet1!r2c3} = "TRUE" "positive" "{IF {LINK Excel.sheet.8 "my
documents\\report info.xlsb"sheet1!r2c4} = "TRUE" "positive" "negative"}"}"}
TIA
 
P

Peter Jamieson

1. Are the LINK fields all coming in as text? I suggest you add \t at
the end of each LINK field
2. If there is any possibility that your document might have bookmarks
called TRUE or FALSE, ensure that you put the LINK fields inside
double-quotes.

{ IF "{ LINK Excel.sheet.8 "my documents\\report info.xlsb"sheet1!r2c2
\t }" = "TRUE"

etc.

Peter Jamieson

http://tips.pjmsn.me.uk
 
B

BABs

I added the \a \f 4 \r \* CHARFORMAT to the linked fields and now it works
fine.
What does the \t do?


Thanks.
 
P

Peter Jamieson

\t inserts the linked obect in text-only format.

If you're just using the LINK for comparison inside an IF, that's
probably the only switch you actually need, although \u might be a
better bet in some cases.

But \r should also work. \f 4 and certainly \*Charformat would only
really come into play if you needed to preserve the appearance of the
text rather than its content, but AFAICS they would do no harm in this case.

Most of this stuff is at

http://office.microsoft.com/en-us/word/HP051861701033.aspx

if you didn't find the relevant switch documentation.

Peter Jamieson

http://tips.pjmsn.me.uk
 

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