+ Reply to Thread
Results 1 to 2 of 2

#VALUE! Error and Calling Auxiliary Functions

  1. #1
    Registered User
    Join Date
    07-26-2016
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    18

    #VALUE! Error and Calling Auxiliary Functions

    Hi all,

    I have encountered 2 separate problems with my VBA codes. Just to let you know I am just a beginner so these problems may seem trivial. I am using Excel 2013 for all scripts.

    1) Here I am writing a code to determine NPV and I can't seem to get the function to work. The script as I have typed them is below:
    Please Login or Register  to view this content.
    When testing out the code on Excel worksheet I get the error #VALUE!


    2) For the second problem I have written 2 auxiliary functions and a main function to call the auxiliary functions. The scripts for all the auxiliary and main functions are below:

    Please Login or Register  to view this content.
    Compute(cf) above is what VBA indicates to be the error saying: Type Mismatch: Array or user-defined type is expected. So I was wondering how I can call my auxiliary cf function in the main function.

    Thanks a lot for the help guys!

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 07-26-2016 at 10:32 AM. Reason: code tags

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: #VALUE! Error and Calling Auxiliary Functions

    Instead of x1ToRight use xltoRight. I am not sure that is the only problem but it is certainly a problem.

    Declare your function like this:
    Please Login or Register  to view this content.
    These problems are due to lack of variable type declarations. You should always use Option Explicit and declare all your variables.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Calling Functions in Userform
    By agony_ibis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2013, 01:10 AM
  2. Calling functions gets error 13 mismatch?
    By JRae in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2013, 09:23 AM
  3. Replies: 1
    Last Post: 02-10-2012, 05:27 PM
  4. calling functions
    By stevedomer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2011, 07:44 PM
  5. calling functions
    By detlion1643 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2009, 10:22 AM
  6. Calling Functions
    By Phatslugga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2007, 04:52 AM
  7. DDE - calling Matlab Functions
    By Noel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2005, 01:10 PM
  8. Calling functions in different modules
    By CR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2005, 12:06 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