Re: inputing data into dynamic arrays

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alan Beban (alannospambeban_at_pacbell.net)
Date: 02/26/04


Date: Thu, 26 Feb 2004 15:11:41 -0800


     Dim rng As Range, arr() As Variant
     Set rng = Range("A1").Resize(Application.CountA(Range("A1:A65336")))
     arr = rng.Value

Alan Beban

margie < wrote:
> Maybe I should try to clarify myself. Suppose a user inputs
> A
> 1 red
> 2 orange
> 3 yellow
> 4 green
> 5 blue
>
> (in a worksheet this is column A rows 1 through 5).
>
> Now I need a function that will read these inputs and store them in an
> array. But lets say tomorrow the user inputs 6 colors instead of 5.
> The array is dynamic so you don't know how many values will be stored
> in the array until it's put into the worksheet. How do I write this in
> VB so that it stores the values in an array.
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>



Relevant Pages

  • Re: inputing data into dynamic arrays
    ... (in a worksheet this is column A rows 1 through 5). ... Now I need a function that will read these inputs and store them in an ... But lets say tomorrow the user inputs 6 colors instead of 5. ... The array is dynamic so you don't know how many values will be stored ...
    (microsoft.public.excel.programming)
  • Re: Finding the nearest match without reusing results
    ... comparing an array with a value generates an array of Trues and ... Any diff with wrong State or with used Store is implicitly zeroed out. ... Each must be larger than the absolute value of the maximum Sales ... go.....it just needs to return the closest match. ...
    (microsoft.public.excel.programming)
  • Re: read keyboard input and storing in an array?
    ... > I'm trying to store user input in an array, ... You have the beginnings of that logic already since your prompt tells the ... 201st value since the array only has room for 200 values. ... This will force you to store the int values as Integer ('Integer' ...
    (comp.lang.java.help)
  • Re: Challenge: reading ascii data
    ... to store all the data before producing any output. ... would be bad practice in terms of memory consumption to use a standard ... So I use hashes to create a two-level "sparse array", ... Well the original problem definition was: ...
    (comp.lang.fortran)
  • Re: attempting an actual game...
    ... >>> and inflexible by the absurd decision to use a bit array for square ... as then one has 8 bits in which to store a color and a few flags ... Using a 2D int (or, ... > Change direction and you may eventually complete a game. ...
    (comp.games.development.programming.misc)