LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Complex strings break 'Evaluate' UDF

Hi,

I'm struggling to get a complex formula to be calculated by the
Evaluate method, called from a UDF. Something simple, like
"=sum(1,2,3)" works fine, but my complex formula returns a #VALUE
error. I have a formula that calculates to the following string:

=IF(OR($A12="",ProductName=""),"",SUMIF(BCs!$T$2:$ T$178,'Product
Detail'!$A12&"*",INDIRECT("BCs!r2c"&MATCH(L$11,IND IRECT("bcs!
r2c"&23+VLookupCode&":r2c256",0),0)+22+VLookupCode &":r178c"&MATCH(L
$11,INDIRECT("BCs!r2c"&23+VLookupCode&":r2c256",0) ,0)+22+VLookupCode,
0)))

When plugged into a cell, the formula works fine. When I use my UDF
(eval(etc.)), it fails. I've tried putting the string directly into
VBA with extra quotes as necessary--I can tell by using the 'Watch'
window that it's entered exactly the same as I'm entering it in the
spreadsheet.

I had a similar problem yesterday on another Evaluate and was able to
solve it by doing a more 'local' Evaluate (something like
Range("A1").Application.Evaluate(Range("A1").Value )... worked, while
just Evaluate(Range("A1").Value) did not).

I'm using Excel 2003 on WinXP. Thanks in advance for any ideas!

 
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 text strings as a formula Nick Flyger Excel Programming 5 October 4th 06 11:08 AM
Finding text strings in complex situations Hardel Excel Discussion (Misc queries) 6 July 25th 06 01:55 PM
Break up strings into separate cells al007 Excel Programming 4 November 23rd 05 11:14 PM
Combining Text Strings - Complex ksawyers Excel Worksheet Functions 1 August 9th 05 08:11 PM
Complex Text Strings|Variables cogent Excel Programming 4 April 8th 04 02:45 AM


All times are GMT +1. The time now is 10:22 AM.

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"