View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default Ranges and Arrays - Passing values

Just to mention an idea. With the use of "CurrentRegion," your array size
is unknown. However, the output range (C5:F13) is "hard coded." See if
you could use this general idea.

Sub Demo()
Dim TestArray
TestArray = Range("C5").CurrentRegion.Value
'// Your code here...then

Range("C5").Resize _
(UBound(TestArray, 1), UBound(TestArray, 2)) = TestArray
End Sub

HTH
--
Dana DeLouis
Win XP & Office 2003


"Don Lloyd" wrote in message
...
Hi again,

Sorry to have bothered you but Problem solved. e.g.

Range("C5:F13").Value = TestArray

Thanks and regards,
Don

"Don Lloyd" wrote in message
...
Hi,

I can populate an array from a range quite easily, e.g.

Dim TestArray as Variant
TestArray = Range("C5").CurrentRegion.Value

Is there a way to pass values back to the range in a similar fashion ?
That is, without referring to the individual Array and Cell co-ordinates.

regards,
Don