I want to copy and transpose a range multiple times and looking for the fastest way to do this. Have written to different ways which both are quite slow. They look like this:
...
For i = 1 To nrofSims
simNr = i
Application.Calculate
Range(Sim.Range("Res3Top").Offset(1, 0), Sim.Range("Res3Top").Offset(simMonths, 0)).Copy
Res3.Range("A4").Offset(i, 1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
Next i
...
and
...
For i = 1 To nrofSims
simNr = i
Application.Calculate
For j = 1 To simMonths
Res3.Range("A4").Offset(i, j) = Sim.Range("Res3Top").Offset(j, 0).Value
Next j
Next i
...
Is it possible to do something like rangePaste.value = rangeCopy.value
and transposing the vector?
Edit:
Changed to the following code instead which is a little faster. But, as written in the comments, I maybe need the change the way my model is working right now.
...
Dim res3Sim As Range, res3Store As Range
Set res3Sim = Range(Sim.Range("Res3Top").Offset(1, 0), Sim.Range("Res3Top").Offset(simMonths, 0))
Set res3Store = Range(Res3.Range("A4"), Res3.Range("A4").Offset(0, simMonths - 1))
Dim i As Integer
For i = 1 To nrofSims
simNr = i
Application.Calculate
res3Store.Offset(i, 1).Value2 = Application.Transpose(res3Sim.Value2)
Next i
...