Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Step back
How do you translate this into vba code?
for i = (N-1) downto 0 do for j = 0 to i do C[j] = disc * ( p*C[j+1] + (1-p)*C[j] ) 1. Particularly the part about "downto", so instead of running i from 0 to (N-1), this is a step-back running from (N-1) to 0. 2. How do you make the Function remember each individual value C[j] from j = 0 to i |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Step back
Hi
try Dim N as integer Dim i as integer Dim j as integer Dim C() N=10 Redim C(N) for i = (N-1) to 0 step -1 for j = 0 to i C(j)=disc * ( p*C[j+1] + (1-p)*C[j] ) next j next i Whatever disc and p is -----Original Message----- How do you translate this into vba code? for i = (N-1) downto 0 do for j = 0 to i do C[j] = disc * ( p*C[j+1] + (1-p)*C[j] ) 1. Particularly the part about "downto", so instead of running i from 0 to (N-1), this is a step-back running from (N-1) to 0. 2. How do you make the Function remember each individual value C[j] from j = 0 to i . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a Drop Down List with Step by Step Instructions for 2007 | Excel Worksheet Functions | |||
Need step by step to add invoice numbering to excel template | New Users to Excel | |||
Need step by step instructions to try, not a demo. Can't remember | Excel Worksheet Functions | |||
What is the step-by-step procedure for making a data list? | Excel Discussion (Misc queries) | |||
I need step by step instructions to create a macro for 10 imbedde. | Excel Worksheet Functions |