Consulting

Results 1 to 2 of 2

Thread: Not able to copy a VBA array with formulas into an Excel range

  1. #1

    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?

    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.

  2. #2
    VBAX Regular
    Joined
    Feb 2009
    Posts
    29
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •