+ Reply to Thread
Results 1 to 2 of 2

Paste from one sheet to another and variable update relative to destination sheet

  1. #1
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Paste from one sheet to another and variable update relative to destination sheet

    Hey guys!

    I'm trying to copy and paste a formula from one page to multiple pages in my workbook using Excel 2010, while having the sheet variables update relative to the destination sheet. Basically what I'm trying to achieve is the previous years difference with my formulas, which actually works; it's just that the sheet variable does not change during the copy/paste procedure.

    Quick example:
    Sheets
    Taxes 2012, Taxes 2013, Taxes 2014

    Some of the formulas I'm copying to each sheet (I didn't list all, I figure once I see an example of one or two of these I could figure it out):

    =E36-SUM('Taxes 2012'!E11:E35)
    =E40-'Taxes 2012'!E10-'Taxes 2012'!E36
    =(G40-'Taxes 2012'!G40)/'Taxes 2012'!G40

    Those formulas are for sheet "Taxes 2013", and are looking for the previous years difference from "Taxes 2012". But If I copy them as they are for future Tax sheets, "Taxes 2012" remains the static variable.

    Thanks
    Mike

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Paste from one sheet to another and variable update relative to destination sheet

    hi Mike. use the INDIRECT formula & the CELL formula to help you. the added portion in red will give you what you need:
    =E36-SUM(INDIRECT("'Taxes 20"&TEXT(RIGHT(CELL("filename",$A$1),2)-1,"00")&"'!E11:E35"))

    the same can be done for the rest. it basically obtains the last 2 digit of the current sheet name & deduct 1.
    =E40-INDIRECT("'Taxes 20"&TEXT(RIGHT(CELL("filename",$A$1),2)-1,"00")&"'!E10")-INDIRECT("'Taxes 20"&TEXT(RIGHT(CELL("filename",$A$1),2)-1,"00")&"'!E36")
    =(G40-INDIRECT("'Taxes 20"&TEXT(RIGHT(CELL("filename",$A$1),2)-1,"00")&"'!G40"))/INDIRECT("'Taxes 20"&TEXT(RIGHT(CELL("filename",$A$1),2)-1,"00")&"'!G40")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1