Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Make ArrayOne = ArrayTwo

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
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
Make table query will work in datasheet view but will not make tab WildlyHarry Excel Discussion (Misc queries) 0 August 28th 07 03:06 PM
How do I make make comment format default? delta_charm Excel Discussion (Misc queries) 1 July 8th 06 10:59 PM
make macros usable! make instructions in plain english !!!! Brainless_in_Boston Excel Worksheet Functions 0 March 2nd 06 03:27 PM
How do I make each row add up seperatly? Please make it easy... Homeade baker and candy maker New Users to Excel 1 October 23rd 05 09:52 PM
how do I make make my hyperlinks show the email address they are . Dustin Excel Discussion (Misc queries) 0 January 13th 05 01:39 AM


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