Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inputing data into dynamic arrays

This seems like a really simple thing but I can't seem to figure it out
I need a function that will read data that a user inputs in an exce
worksheet and store it into an array. The amount of data the use
inputs varies from day to day. So for example, a user will inpu
order numbers in column A starting in row 1 and going down the column.
One day there may be a list of 10 order numbers, another day there ma
be 20 order numbers and so on. How do I write a function that wil
read those inputs and store them into an array

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default inputing data into dynamic arrays

Margie,

You sat arrays, but talk of rows, so I assume that you mean worksheets.

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
Cells(cLastRow+1,"A").Value = "whatever"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"margie " wrote in message
...
This seems like a really simple thing but I can't seem to figure it out.
I need a function that will read data that a user inputs in an excel
worksheet and store it into an array. The amount of data the user
inputs varies from day to day. So for example, a user will input
order numbers in column A starting in row 1 and going down the column.
One day there may be a list of 10 order numbers, another day there may
be 20 order numbers and so on. How do I write a function that will
read those inputs and store them into an array?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inputing data into dynamic arrays

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 a
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 store
in the array until it's put into the worksheet. How do I write this i
VB so that it stores the values in an array

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
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/


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
Dynamic Arrays chaz Excel Discussion (Misc queries) 1 May 23rd 06 12:43 AM
Dynamic Range and arrays PR Excel Discussion (Misc queries) 2 November 14th 05 03:51 AM
Dynamic arrays Driver New Users to Excel 3 November 7th 05 10:11 PM
Dynamic Arrays Chiba Excel Worksheet Functions 2 July 9th 05 03:58 AM
dynamic arrays in excel Koos Excel Programming 2 January 10th 04 02:30 PM


All times are GMT +1. The time now is 05:28 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"