#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
Need step by step instructions to try, not a demo. Can't remember [email protected] Excel Worksheet Functions 0 June 15th 06 10:05 AM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"