• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Running automatically VBAs

pao13

Member
Hi. What I'm looking to do is very tough and I don't know if it can be done in Excel but I will try! Let's explain first what I'm doing. I will try to explain as much as I can but english is not my native language so bear with me!

I'm attaching my workbook. In the first spreadsheet I have closing daily prices of a certain stock. In the events in the grey table I "populate" all the days that an event happened. (event when the stock falls 10% or the options expire). In the second spreadsheet "P_L events up to 2 months" the first row always has the same date with the first spreadsheet. From the second row and afterwards I run a macro (copy_paste_1) that pastes all the events from the grey table in the first spreadsheet but duplicate. I perform automatically certain calculation to come up with what I want: the number in the last row and column of the "table", in this case K37.

What I'm asking if it can be done automatically
To have a macro that automatically runs the events from -1% to -10% (what I've done not automatically for 10%) and results eg.

-10% -85,916 (K37 in this case but will not be K37 always)
-9% ...
-8% ...

So when I write -10% in cell S2 of the first spreadsheet to have a macro that automatically runs the copy_paste_1 macro in the second spreadsheet and "write" somewhere the result of the last row and column (in this case K37). When I write 9% do the same thing etc.

Preferably what I would want is not even to write -10, -9 etc but to do it automatically.

Hope you understand what I'm trying to do!
Thanks for any help!
 

Attachments

  • RSX DATA28.xlsm
    262.1 KB · Views: 5
What range of Event Values do you want to allow to use ?
is it -10 to -1 % in steps of 1%?
 
Thank you for your questions and sorry for not clarifying.
Yes it is in steps of 1%.

The -85,916 (total P/L) is not 10% of something. At each event I selected in the first sheet I sell 100 put options and then at each date I close the position and start a new one. So the -85,916 is the loss after all the calculations. I don't want to calculate all these steps with a macro. What I would like a macro to do is: When I enter -1%, to automatically run the macro copy_paste_1 in the second sheet and when this happens the total P/L will be automatically calculated. So if it's possible the macro to take the last row with the total P/L and write it at another sheet.
 
Back
Top