Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Dynamic Array (multiple columns) Question

I'm trying to create a dynamic array of data.

I had previously dimensioned at the top of my sub the following:
Public ItemArray(10,7) As Variant

This gets me what I want, but only for 10 entries. I may actually
have 50 entries.
How do you dimension an array such that the amount of entries
changes / is dynamic?

The array is currently inside of a loop for items, and I want the
array to update as below with each item.

Hopefully this is enough information to piece together what I'm
looking for.
Thanks, Neil


ItemCount = ItemCount + 1
ItemArray(ItemCount, 0) = ItemName
ItemArray(ItemCount, 1) = AAvariable
ItemArray(ItemCount, 2) = BAvariable
ItemArray(ItemCount, 3) = CAvariable
ItemArray(ItemCount, 4) = DAvariable
ItemArray(ItemCount, 5) = EAvariable
ItemArray(ItemCount, 6) = FAvariable
ItemArray(ItemCount, 7) = GAvariable
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Dynamic Array (multiple columns) Question

Hi,

A dynamic array can be used by delaring the line below.
Dim DynamicArray() As Long

& then re dimension it to number that you need (10,50 or whatever. )

ReDim DynamicArray(1 To 10)

Plz check this link on using arrays (static & dynamic)
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Have a good read ;)

--
Tausif Mohammed


"pallaver" wrote:

I'm trying to create a dynamic array of data.

I had previously dimensioned at the top of my sub the following:
Public ItemArray(10,7) As Variant

This gets me what I want, but only for 10 entries. I may actually
have 50 entries.
How do you dimension an array such that the amount of entries
changes / is dynamic?

The array is currently inside of a loop for items, and I want the
array to update as below with each item.

Hopefully this is enough information to piece together what I'm
looking for.
Thanks, Neil


ItemCount = ItemCount + 1
ItemArray(ItemCount, 0) = ItemName
ItemArray(ItemCount, 1) = AAvariable
ItemArray(ItemCount, 2) = BAvariable
ItemArray(ItemCount, 3) = CAvariable
ItemArray(ItemCount, 4) = DAvariable
ItemArray(ItemCount, 5) = EAvariable
ItemArray(ItemCount, 6) = FAvariable
ItemArray(ItemCount, 7) = GAvariable

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Dynamic Array (multiple columns) Question

Couldn't find anything on 2 dimensional arrays, only single dimension
arrays.... Did I miss something there?


On 7$B7n(B24$BF|(B, $B8a8e(B3:30, Tausif wrote:
Hi,

A dynamic array can be used by delaring the line below.
Dim DynamicArray() As Long

& then re dimension it to number that you need (10,50 or whatever. )

ReDim DynamicArray(1 To 10)

Plz check this link on using arrays (static & dynamic)http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Have a good read ;)

--
Tausif Mohammed



"pallaver" wrote:
I'm trying to create a dynamic array of data.


I had previously dimensioned at the top of my sub the following:
Public ItemArray(10,7) As Variant


This gets me what I want, but only for 10 entries. I may actually
have 50 entries.
How do you dimension an array such that the amount of entries
changes / is dynamic?


The array is currently inside of a loop for items, and I want the
array to update as below with each item.


Hopefully this is enough information to piece together what I'm
looking for.
Thanks, Neil


ItemCount = ItemCount + 1
ItemArray(ItemCount, 0) = ItemName
ItemArray(ItemCount, 1) = AAvariable
ItemArray(ItemCount, 2) = BAvariable
ItemArray(ItemCount, 3) = CAvariable
ItemArray(ItemCount, 4) = DAvariable
ItemArray(ItemCount, 5) = EAvariable
ItemArray(ItemCount, 6) = FAvariable
ItemArray(ItemCount, 7) = GAvariable- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -


- $B0zMQ%F%-%9%H$rI=<((B -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Dynamic Array (multiple columns) Question

You can get some additional information by typing ReDim in the Immediate
Window or in any code window then, with the caret (text cursor) touching the
word, press F1.

Rick


"pallaver" wrote in message
...
Couldn't find anything on 2 dimensional arrays, only single dimension
arrays.... Did I miss something there?


On 7$B7n(B24$BF|(B, $B8a8e(B3:30, Tausif wrote:
Hi,

A dynamic array can be used by delaring the line below.
Dim DynamicArray() As Long

& then re dimension it to number that you need (10,50 or whatever. )

ReDim DynamicArray(1 To 10)

Plz check this link on using arrays (static &
dynamic)http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Have a good read ;)

--
Tausif Mohammed



"pallaver" wrote:
I'm trying to create a dynamic array of data.


I had previously dimensioned at the top of my sub the following:
Public ItemArray(10,7) As Variant


This gets me what I want, but only for 10 entries. I may actually
have 50 entries.
How do you dimension an array such that the amount of entries
changes / is dynamic?


The array is currently inside of a loop for items, and I want the
array to update as below with each item.


Hopefully this is enough information to piece together what I'm
looking for.
Thanks, Neil


ItemCount = ItemCount + 1
ItemArray(ItemCount, 0) = ItemName
ItemArray(ItemCount, 1) = AAvariable
ItemArray(ItemCount, 2) = BAvariable
ItemArray(ItemCount, 3) = CAvariable
ItemArray(ItemCount, 4) = DAvariable
ItemArray(ItemCount, 5) = EAvariable
ItemArray(ItemCount, 6) = FAvariable
ItemArray(ItemCount, 7) = GAvariable- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -


- $B0zMQ%F%-%9%H$rI=<((B -



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Dynamic Array (multiple columns) Question

You needed to check the create arrays section. Below is the exact link.

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
--
Tausif Mohammed


"pallaver" wrote:

Couldn't find anything on 2 dimensional arrays, only single dimension
arrays.... Did I miss something there?


On 7月24日, 午後3:30, Tausif wrote:
Hi,

A dynamic array can be used by delaring the line below.
Dim DynamicArray() As Long

& then re dimension it to number that you need (10,50 or whatever. )

ReDim DynamicArray(1 To 10)

Plz check this link on using arrays (static & dynamic)http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Have a good read ;)

--
Tausif Mohammed



"pallaver" wrote:
I'm trying to create a dynamic array of data.


I had previously dimensioned at the top of my sub the following:
Public ItemArray(10,7) As Variant


This gets me what I want, but only for 10 entries. I may actually
have 50 entries.
How do you dimension an array such that the amount of entries
changes / is dynamic?


The array is currently inside of a loop for items, and I want the
array to update as below with each item.


Hopefully this is enough information to piece together what I'm
looking for.
Thanks, Neil


ItemCount = ItemCount + 1
ItemArray(ItemCount, 0) = ItemName
ItemArray(ItemCount, 1) = AAvariable
ItemArray(ItemCount, 2) = BAvariable
ItemArray(ItemCount, 3) = CAvariable
ItemArray(ItemCount, 4) = DAvariable
ItemArray(ItemCount, 5) = EAvariable
ItemArray(ItemCount, 6) = FAvariable
ItemArray(ItemCount, 7) = GAvariable- 引用テ*ストを表示しない -


- 引用テ*ストを表示 -





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
Lookup Question with multiple dynamic variables Robin Excel Worksheet Functions 14 June 12th 08 09:40 PM
Offset code for dynamic row# & multiple columns in LINEST function RJ Excel Worksheet Functions 3 May 29th 07 06:29 PM
Dynamic multiple-condition array function with more than one name Gary F Excel Worksheet Functions 3 September 15th 06 03:24 PM
UDF to sort array with multiple columns flygis Excel Worksheet Functions 0 June 2nd 06 06:00 PM
Vlookup against multiple columns/worksheets question JCarter Excel Discussion (Misc queries) 8 March 9th 05 04:59 PM


All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"