PDA

View Full Version : Not able to copy a VBA array with formulas into an Excel range



musicgold
03-25-2009, 08:42 AM
Hi,
I am trying to transfer the contents of an array into a range of Excel (red line in the code below). Though I am able to do that when the array has values, however, it is giving me an error when the array has formulas.
How can I get this to work?



Dim Vma As Variant
...

TotalRows = .Range("Spread").Count

Vma = Application.Transpose(.Range ("Spread"))

For i = TotalRows To 1 Step -1 Vma(i) = "=RC[-2]- RC[-1])"

Next

.Range("Spread") = Application.WorksheetFunction.Transpose(Vma)

...



Thanks

MG.

AZIQN
03-31-2009, 02:56 PM
What if you simply added a line prior to this section in the code to copy and paste special >> values for the array...
If the formulas are still needed in the array, you'll have to upload an example workbook to look at, because it is unclear what is causing the issue.