Script not Running

  • Pls, I am new to VBA. I copy this script below from a book on how to calculate standard deviation on a data in a sheet and record in separate column.

    The problem I am having is that the script is not running. Please, what could be the reason? Or rather help me modify it. Thanks.


    The script:


  • Read the Forum Rules and you will understand


    Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.


    Also,


    Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the URL from the address bar in your browser) to the cross-post. We are here to help so help us help you!




    Read this to understand why we ask you to do this



    Cross Posting

  • I am sorry for that. I am desperate for quick answer. It will not repeat itself. The cross post is in VBAexpress. Thanks

  • There's no code in the attached workbook.


    I've added the code but it just goes into and endless Loop. Are you sure that you have copied it correctly?

  • I am very sorry for that.

    You are right. That is not the whole code; I copied the first aspect. The code is too long and I did not what to stress you, thinking that if one worked I will be able to manipulate my way through the rest. The whole code is:


    And workbook to apply it to is attached as first attachment


    After the vba script has been run, it will produce a table similar to the one in second attachment.


    In all, this script set to achieve on the workbook:

    1. Align record in the Merged worksheet (that consist five different data each consisting 252 rows) of data base on date and remove unmatched ticker or row of data

    2. Remove blank row of data

    3. Create extra columns for calculation like 'price change', 'log of price change', 'standard deviation' and 'price spike'

    4. Finally, produce the summary table as seen in the attached table

    I really appreciate your kind gesture. Once again, I am sorry for my early attitude. Thanks.

  • Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

  • Noted, sir. I now saw the symbol;I was actually looking for it.

    I am trying to analyse some American stock options historical price using standard deviation method to pick stock with highest price move as can be seen in the summary table attached.

    I copied the script from a book I am reading on it. When I tried to apply the script, it was not running with the workbook (the sample I attached).

    Please help me with it for any modification needed. Thanks.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!