Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, thanks for clearing that up.
RBS "Alan Beban" wrote in message ... It's slightly more complicated than you or Chip articulated. (1)it's neither required that the arrays be declared dynamically Sub test() Dim i As Long Dim arr1(1 To 10) Dim arr2() For i = 1 To 10 arr1(i) = i Next i arr2 = arr1 For i = 1 To 10 Debug.Print arr2(i) Next i End Sub works; nor (2) sufficient that the arrays be declared dynamically Sub test() Dim i As Long Dim arr1() Dim arr2() As Integer ReDim arr1(1 To 10) For i = 1 To 10 arr1(i) = i Next i arr2 = arr1 For i = 1 To 10 Debug.Print arr2(i) Next i End Sub doesn't. Only the array being assigned must be declared dynamically, and the arrays must be of the same type. Alan Beban RB Smissaert wrote: Sub test() Dim i As Long Dim arr1() As Long Dim arr2() As Long ReDim arr1(1 To 10) As Long For i = 1 To 10 arr1(i) = i Next i arr2 = arr1 For i = 1 To 10 Debug.Print arr2(i) Next i End Sub As Chip said you can assign directly if the arrays are declared dynamically, not static. RBS "Mike H." wrote in message ... What do I have to do to allow this statement to compile. I want to assign all the elements in one array to the other array. Obviously the "long" way would be to assign element by element, but is there a faster way? Let ItemDataTmp() = ItemData() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make table query will work in datasheet view but will not make tab | Excel Discussion (Misc queries) | |||
How do I make make comment format default? | Excel Discussion (Misc queries) | |||
make macros usable! make instructions in plain english !!!! | Excel Worksheet Functions | |||
How do I make each row add up seperatly? Please make it easy... | New Users to Excel | |||
how do I make make my hyperlinks show the email address they are . | Excel Discussion (Misc queries) |