Solved

Copying arrays

Posted on 1998-06-27
1
141 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
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 64
Search combo error "Data Type Mismatch in Criteria Expression" 2 71
Added a column screws up code 5 63
MsgBox 4 69
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

828 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