2D array

ericlch16

Active Member
Joined
Nov 2, 2007
Messages
311
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hi Experts,

I have a range that I copied to a 2D array.

Now i want to copy from column 3 to column 10 from the 2D array to a range in excel. I read i can use application.index but if copies either the whole row or whole column. I want specific columns

for example

range(cells(1,1),cells(1,8)0 = array(2,3) to array array(2,10)

Can this be done without looping ? Looping takes too much time and i would like to avoid to loop. :)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You can do that like
VBA Code:
Sub ericlch()
   Dim Ary As Variant
   
   Ary = Sheets("Pcode").Range("A2:M20").Value2
   Sheets("Sheet1").Range("A2").Resize(UBound(Ary), 8).Value = Application.Index(Ary, Evaluate("row(1:" & UBound(Ary) & ")"), Evaluate("column(C:J)"))
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,254
Messages
6,123,893
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top