View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_4_] Alan Beban[_4_] is offline
external usenet poster
 
Posts: 171
Default inputing data into dynamic arrays

Dim rng As Range, arr() As Variant
Set rng = Range("A1").Resize(Application.CountA(Range("A1:A6 5336")))
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/