471,853 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Array issue

Hi, I am trying to create an array that starts with a calculation and then assigns that variable to the first element of the array. From there the loop attempts to generate each suceeding element of the array based on the previous element and some simple algebra. Let's say that input3 generates a number that equals 2540. From there i redim the table, assign input3 to the first element and proceed to generate the array with the condition that Tble(rw) is less then 2550. I am pretending that i don't know how many elements in the array it will take to get to 2550, otherwise it would be easy. If this sounds kind of ridiculous, I am really trying to use this as an example for when i really won't know the number of elements to get to a given criteria. If anyone has any ideas id appreciate it. Below is what i have so far. Thanks

Sub Test()
Dim Input1, Input2, Input3, Box As Double
Dim Tble() As String
Dim rw, x, y As Integer

Input1 = Cells(1, 1).Value
Input2 = Cells(2, 1).Value

Input3 = Input1 * Input2

Cells(3, 1).Value = Input3

ReDim Preserve Tble(rw)
Tble(0) = Input3
rw = 1
Do
Tble(rw) = Tble(rw - 1) + 1
Loop While Tble(rw) <= 2550
Jul 16 '07 #1
0 883

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by buda | last post: by
29 posts views Thread by shmartonak | last post: by
4 posts views Thread by Peter | last post: by
21 posts views Thread by yeti349 | last post: by
14 posts views Thread by Shhnwz.a | last post: by
272 posts views Thread by Peter Olcott | last post: by
33 posts views Thread by Zytan | last post: by
17 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.