PC Review


Reply
Thread Tools Rate Thread

Array with unknown elements(apologies if reposted)

 
 
mareharbor@yahoo.com
Guest
Posts: n/a
 
      16th Jul 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
array of zero elements George3 Microsoft VC .NET 0 17th Feb 2008 10:25 AM
Handling unknown elements with a ConfigurationElement dennis.doomen@gmx.net Microsoft Dot NET Framework 0 16th Nov 2006 07:33 PM
Handling unknown elements with a ConfigurationElement dennis.doomen@gmx.net Microsoft Dot NET Framework 0 16th Nov 2006 07:25 PM
SUM array elements Bill Microsoft Access Form Coding 3 1st Aug 2006 05:33 PM
Comparing ARRAY elements with RANGE data and created a 2nd array JimP Microsoft Excel Worksheet Functions 2 10th Mar 2004 07:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:40 PM.