View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
musicgold via OfficeKB.com musicgold via OfficeKB.com is offline
external usenet poster
 
Posts: 7
Default Not able to copy a VBA array with formulas into an Excel range

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?

VBA Code:
...
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.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200903/1