View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tony Tony is offline
external usenet poster
 
Posts: 1
Default Pasting an array into a range

Hi all:

I get a runtime 'type mismatch' on the last statement
(i.e., r.Value = ). Any thoughts?

Sub test()
Dim r As Range
Set r = ActiveSheet.Range("A1:A50000")

Dim arr() As Long
Dim i As Long
ReDim arr(1 To 50000)
For i = 1 To 50000
arr(i) = i
Next i

r.Value = Application.WorksheetFunction.Transpose(arr)

End Sub

Thanks, Tony