Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default EVALUATE method returns zero

I have a UDF which uses EVALUATE ( )

If I take the contents of the bracket and put it into a cell then Excel
calculates the correct answer, but I get zero from Evaluate.

The contents of the bracket is a SUMPRODUCT formula.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default EVALUATE method returns zero

Hi Rob,

<I take the contents of the bracket and put it into a cell then Excel calculates the correct answer

The way one refers to cells in a worksheet differs from how it's done in VBA.
What's your formula?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Rob" wrote in message ...
|I have a UDF which uses EVALUATE ( )
|
| If I take the contents of the bracket and put it into a cell then Excel
| calculates the correct answer, but I get zero from Evaluate.
|
| The contents of the bracket is a SUMPRODUCT formula.
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default EVALUATE method returns zero

See below from the Imediate window. If I put the formula onto my sheet it
works, but I get the error when I try to evaluate the statement.


?"=SUMPRODUCT((Ex_Sales_Date=""" & SalesDate & """*1)*1,
(Ex_Sales_Yield1=""" & Yield_1 & """)*1,(Ex_Sales_Yield2=""" & Yield_2 &
""")*1,(Ex_Sales_Yield3=""" & Yield_3 & """)*1,Ex_Sales_Volume)"
=SUMPRODUCT((Ex_Sales_Date="27/01/2008"*1)*1,
(Ex_Sales_Yield1="")*1,(Ex_Sales_Yield2="")*1,(Ex_ Sales_Yield3="")*1,Ex_Sales_Volume)

?application.Evaluate("=SUMPRODUCT((Ex_Sales_Date= """ & SalesDate &
"""*1)*1, (Ex_Sales_Yield1=""" & Yield_1 & """)*1,(Ex_Sales_Yield2=""" &
Yield_2 & """)*1,(Ex_Sales_Yield3=""" & Yield_3 & """)*1,Ex_Sales_Volume)")
Error 2015


"Niek Otten" wrote:

Hi Rob,

<I take the contents of the bracket and put it into a cell then Excel calculates the correct answer

The way one refers to cells in a worksheet differs from how it's done in VBA.
What's your formula?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Rob" wrote in message ...
|I have a UDF which uses EVALUATE ( )
|
| If I take the contents of the bracket and put it into a cell then Excel
| calculates the correct answer, but I get zero from Evaluate.
|
| The contents of the bracket is a SUMPRODUCT formula.
|
|



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evaluate Method Returns Type Mismatch todtown Excel Programming 9 November 20th 07 11:26 PM
Evaluate Method Returns Type Mismatch todtown Excel Programming 0 November 20th 07 07:26 PM
Evaluate Method Returns Type Mismatch todtown Excel Programming 0 November 20th 07 07:26 PM
EVALUATE Method and arguments lumpus Excel Programming 0 September 25th 07 08:40 PM
Strange (?) Evaluate Method Behavior Johnny Meredith Excel Worksheet Functions 0 March 3rd 06 02:28 PM


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"