View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Jag Man Jag Man is offline
external usenet poster
 
Posts: 38
Default Transferring ranges to/from arrays

Alan,

Oops! Yes, you are right. As a matter of fact, I demonstrated that in
my example. But, can you contradict my conclusion that you can't do the
reverse?
E.g.,

inVars = Range("x").Resize(2, 1).Value
Dim inArgs(2) As Double

inArgs = inVars ' Won't work. Cannot assign to array

Thanks for your interest.


Ed


Jag Man wrote:
. . .The
upshot is that (a) Only Variants can
be used to move data to/from ranges . . . .


From yes, to no. The following works:

Sub testIt()
Dim arr(3) As Long
arr(1) = 1
arr(2) = 2
arr(3) = 3
Range("A1:C1").Value = arr
End Sub

Alan Beban

"Alan Beban" wrote in message
...
Jag Man wrote:
. . .The
upshot is that (a) Only Variants can
be used to move data to/from ranges . . . .


From yes, to no. The following works:

Sub testIt()
Dim arr(3) As Long
arr(1) = 1
arr(2) = 2
arr(3) = 3
Range("A1:C1").Value = arr
End Sub

Alan Beban