Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Gatorbaby03 Gatorbaby03 is offline
external usenet poster
 
Posts: 2
Default Write an IF function for Excel while in Word

Can anybody help me to figure this out? I'm not really sure what to do for
this. Thank you
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
jille jille is offline
external usenet poster
 
Posts: 7
Default Write an IF function for Excel while in Word

Not sure what you're up to but the single line of code that accesses an excel
function could look like this:

result= Excel.Application.WorksheetFunction.if(a1 = b1, "true", "false")

Three things to do first though:

-You have to declare the worksheet in question as an object
-create the object using GetObject or CreateObject (probably GetObject since
I assume you already have an Excel file)
-and also attach the Excel object model (References)

Hope this gets you started in the right direction
Jille


"Gatorbaby03" wrote:

Can anybody help me to figure this out? I'm not really sure what to do for
this. Thank you

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Gatorbaby03 Gatorbaby03 is offline
external usenet poster
 
Posts: 2
Default Write an IF function for Excel while in Word

I'm taking a class in Microsoft Excel, part 1 of our assignment states: Open
MS Word and write an IF function for cell H3 that assigns the value of cell
A7 to cell H3 if the value in cell J7 is less than the value in cell Q2;
otherwise, have the IF function assign zero(0) to cell H3.
I'm sure we haven't done this in my class, we've only done IF functions on
Excel itself. If you by chance understand this could you explain it to me. I
was still confused after reading what you wrote.
Thanks,
Tiffany

"jille" wrote:

Not sure what you're up to but the single line of code that accesses an excel
function could look like this:

result= Excel.Application.WorksheetFunction.if(a1 = b1, "true", "false")

Three things to do first though:

-You have to declare the worksheet in question as an object
-create the object using GetObject or CreateObject (probably GetObject since
I assume you already have an Excel file)
-and also attach the Excel object model (References)

Hope this gets you started in the right direction
Jille


"Gatorbaby03" wrote:

Can anybody help me to figure this out? I'm not really sure what to do for
this. Thank you

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
jille jille is offline
external usenet poster
 
Posts: 7
Default Write an IF function for Excel while in Word

OK,

Sounds like you're not looking for a programmatic solution. So there is
actually a couple of ways to approach this according to your description. You
can either embed an Excel spreadsheet in Word and then use the normal
formulas or you can create a table in Word and enter a formula by opening the
Table menu and selecting Formula. There is an option there to use a function
and "if" is one of them.

"Gatorbaby03" wrote:

I'm taking a class in Microsoft Excel, part 1 of our assignment states: Open
MS Word and write an IF function for cell H3 that assigns the value of cell
A7 to cell H3 if the value in cell J7 is less than the value in cell Q2;
otherwise, have the IF function assign zero(0) to cell H3.
I'm sure we haven't done this in my class, we've only done IF functions on
Excel itself. If you by chance understand this could you explain it to me. I
was still confused after reading what you wrote.
Thanks,
Tiffany

"jille" wrote:

Not sure what you're up to but the single line of code that accesses an excel
function could look like this:

result= Excel.Application.WorksheetFunction.if(a1 = b1, "true", "false")

Three things to do first though:

-You have to declare the worksheet in question as an object
-create the object using GetObject or CreateObject (probably GetObject since
I assume you already have an Excel file)
-and also attach the Excel object model (References)

Hope this gets you started in the right direction
Jille


"Gatorbaby03" wrote:

Can anybody help me to figure this out? I'm not really sure what to do for
this. Thank you

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a similar function in Word to data validation in Excel? FinConBH Tables 1 November 28th 06 08:49 PM
Use Word Merge function with Excel to print out progress reports. Jere Mailmerge 0 October 8th 06 04:37 PM
Text to Speech Function is available in Excel but not in Word Shrikant Microsoft Word Help 1 August 9th 05 02:32 PM
Does the Excel function COUNTA work in Word? Susan Tables 1 July 15th 05 05:21 PM
I am trying to write music in MS word. Write the words and notes B Microsoft Word Help 1 May 1st 05 11:28 PM


All times are GMT +1. The time now is 08:29 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"