View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Excel 2003. Assign array to range

Sub AA()
Dim myRange As Range
Dim myarray(1 To 3, 1 To 10) As Long
For i = 1 To 3
For j = 1 To 10
myarray(i, j) = i * j
Next
Next
Set myRange = Range("M10").Resize(1, 10)
myRange.Value = myarray
End Sub

worked fine for me in xl2003.

--
Regards,
Tom Ogilvy


"Jorge Vinuales" wrote:

Hi everyone, and sorry for my english

I have an excel application, developed in Excel XP. In a line of code, I
have this statement:
MyRange.Value = myArray

myArray is a two dimensions array, which has the same number of rows and
columns than the range object I'm trying to assign.

This code runs without problems in XP, but when I try to run it under Excel
2003, I'm getting the error "Application or object defined error".

¿Any suggestion?

thanks