+ Reply to Thread
Results 1 to 2 of 2

Help Needed There are some error in my code

Hybrid View

  1. #1
    Registered User
    Join Date
    10-17-2016
    Location
    LA
    MS-Off Ver
    2016
    Posts
    1

    Help Needed There are some error in my code

    Function AccumulateReturn(myPerf As Range) As Single
    
    Dim accRet As Single
    Dim numObs As Integer
    Dim i As interger
    
    numObs = myPerf.Count
    accRet = 0
    For i = 1 To numObs
    accRet = accRet * (1 + myPerf(i))
    End If
    i = numObs
    Next i
    accRet = accRet - 1
    MsgBox("Accumulated Return from" & Text(acctRet,#0.00) & "Observations is: " TexT(numObs, ##00.00#), vbOkOnly, "My Final" AccumulateReturn = accRet)
    
    End Function
    Last edited by FDibbins; 10-17-2016 at 02:27 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Help Needed There are some error in my code

    Hi, welcome to the forum

    What is wrong with the code? What is it (or is it not) doing that you did (did not) want it to do?

    Sorry to do this to you on your 1st post, but...
    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )

    Also, Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (I will add them for you - this time )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. VBA If/Then Error Help Needed
    By Quinn.Farley in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2016, 10:33 PM
  2. Prevent #DIV/0 error Code Needed
    By JJFletcher in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-07-2015, 04:04 PM
  3. [SOLVED] VBA help needed to capture Error and Remove Pivot if error exist else resume
    By Tescatlipoca in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 05:46 PM
  4. [SOLVED] Password code designed for 5 Users - NAVIGATION Help Needed! - CODE Issue!
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-09-2014, 10:46 AM
  5. RUN TIME ERROR '1004' error handling help needed
    By skop89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2014, 12:54 PM
  6. VBA code needed deserately for similar cells but do not know how to copy code!
    By Gunner_gav in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2013, 03:39 AM
  7. Error in code to skip cells between entry fields - help needed!
    By rache66 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2010, 07:57 AM

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