Results 1 to 3 of 3

Thread: [RESOLVED] Copy formula from another sheet

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Resolved [RESOLVED] Copy formula from another sheet

    I have a long, complex, formula in Range(T2) on one sheet that refers to columns "I2" and "J2" and I have made T2 into a named range called MyNR. I want to copy that formula to column "S9" on a different sheet so I do this
    Code:
    Range("MyNR").Copy
    .Cells(9, "S").PasteSpecial xlPasteFormulas
    When I do that I gat a #VALUE! error because the resulting formula refers to H9 and I9 rather than I9 and J9. How can I avoid that?

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,444

    Re: Copy formula from another sheet

    Use absolute addressing in the formula (F4-Key while your cursor is on the address)
    $I$9
    $J$9
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

Posting Permissions

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



Click Here to Expand Forum to Full Width