View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Dumping the contents of a VBA array to a sheet

Sub DumpArray()
Dim myArray(1 To 65536, 1 To 2) As Long
For i = 1 To 65536
For j = 1 To 2
myArray(i, j) = Fix(Rnd() * 10000 + 1)
Next
Next
Range("A1:B65536").Value = myArray
End Sub


worked fine for me, xl2000, SR1, Win 2K

Regards,
Tom Ogilvy


"Dave" wrote in message
. au...
I've got a VBA array that is 65536 rows by 2 columns (I've truncated it to
fit into two columns) that I'm trying to dump to the A and B columns of a
spreadsheet. I'm getting a Runtime 1004 error a few seconds after the line
of code tries to execute the dump

Presumably I'm trying to dump too much data, if so how do I dump the array
in smaller chunks?

Cheers

Dave