Paste Array into worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a one step way to paste an array into a spreadsheet without having
to cycle through each element?

I have a 9 x 9 array and I want to paste it into cells A1 to I9.

Thanks, Kaval
 
Hi Kaval,

Sub Tester01()
Dim arr(1 To 9, 1 To 9) As Variant
Dim i As Long, j As Long

For i = 1 To 9
For j = 1 To 9
arr(i, j) = i * j
Next j
Next i

Sheets("Sheet3").Range("A1:I9").Value = arr

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top