Assign part of an array to another array

  • Good afternoon, again asking for help.


    I have a doubt related to the following:


    - I have a two-dimensional array, Arr (1 to nTotal, 1 to 4) As Variant


    How can I assign to another Array, Arr1, only the first three Arr values?

    Just doing a loop or is it a simpler way?


    What I want

    Arr1 (1,1) = Arr (1,1) .... Arr1 (1,4) = Arr (1,4)

    Arr1 (2,1) = Arr (2,1) .... Arr1 (2,4) = Arr (2,4)

    Arr1 (3.1) = Arr (3.1) .... Arr1 (3.4) = Arr (3.4)


    Thanks

    JCabral

  • You can slice arrays, in a manner of speaking, in VBA, viz:

  • You can slice arrays, in a manner of speaking, in VBA, viz:

    Perfect! :love:


    Thank you very much

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!