Results 1 to 5 of 5

use "evaluate" to calculate UDF

Threaded View

  1. #1
    Registered User
    Join Date
    02-23-2013
    Location
    earth
    MS-Off Ver
    Excel 2010
    Posts
    21

    use "evaluate" to calculate UDF

    hi,i got one UDF named"Evaluatestr" used to perform calculation for formula in "string" format,but the UDF return #value! error if formula contain other UDF,to make thing simple and easy to understand, i had attached simple udf code and excel file in here



    Option Explicit
    
    Function Evaluatestr(RefCell As String)
    
    'Application.Volatile
    
    Evaluatestr = Evaluate(RefCell)
    
    End Function

    Option Explicit
    
    Function udf(a As Range, b As Double, c As Double, d As Double, e As Double)
    
    'Application.Volatile
    
    udf = Evaluate(" sum(offset(" & a.Address(External:=True) & ",(" & b & "),(" & c & "),(" & d & "),(" & e & "))) ")
    
    End Function
    here ,the result:
    1 SUM(OFFSET(A1,0,0,2,1))+1 7
    2 UDF(A1,0,0,2,1)+1 #VALUE!


    any solution for this?
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  2. How to calculate "Age of Asset" & "Monthly Repayment"‏
    By yjohari in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2013, 07:27 AM
  3. VBA Evaluate Formula and "Copy Down" Result as String/Value to Last Row
    By falkon007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2013, 03:04 AM
  4. Replies: 1
    Last Post: 10-22-2012, 09:38 AM
  5. Using DMIN to evaluate "less than" or "greater than" a specific date
    By williams485 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-01-2012, 12:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1