Solved

Copying arrays

Posted on 1998-06-27
1
143 Views
Last Modified: 2010-05-03
Is there any command used to copy arrays?  Like in HP BASIC you can use a MAT Array_a = Array_b. I would prefer not to use a for..next loop to go through each element and copy them.
0
Comment
Question by:willmrk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
lmorris earned 50 total points
ID: 1464444
This is where a variant comes in real handy. Here is an example of how to copy an array:

Private Sub Command1_Click()
    Dim aArray
    Dim aArray2
   
    ReDim aArray(0 To 10, 0 To 10)
   
    Dim i As Integer
    Dim j As Integer
   
    For i = 0 To 10
        For j = 0 To 10
       
        aArray(i, j) = i * j
       
        Next j
    Next i
   
    aArray2 = aArray
End Sub

0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question