+ Reply to Thread
Results 1 to 6 of 6

Copying formula

Hybrid View

  1. #1
    Registered User
    Join Date
    12-27-2008
    Location
    Christchurch, New Zealand
    Posts
    92

    Copying formula

    I need to copy the below formula and have the cell value stay constant but have the sheet number increase by 7. Is there a way to do this automatically or do I have to change it manually?

    ='S \11\October\[09.xlsm]Figures'!$D$6

    Would copy to become:

    ='S \11\October\[16.xlsm]Figures'!$D$6

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,890

    Re: Copying formula

    The usual way to do this is by using the INDIRECT function and using a formula based on row number to increment by 7. However, be aware that references to external workbooks as this appears to be, rather than worksheets within the same workbook, requires each external workbook to be open, which may not be convenient for you.

    For example, if your formula starts in row 1, use this
    =INDIRECT("'S \11\October\[" & TEXT(ROW()*7+2,"00") & ".xlsm]Figures'!$D$6")
    If that is tantalizing close but you don't want the workbooks to be open you have two choices (that I can think of):

    1. Use a handy macro called INDIRECT.EXT
    2. Write a macro that writes the formulas for you with the correct sheet reference
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Copying formula

    hm.... maybe try building the string in one column for the workbook part:

    ="[" & counta($A2:$A$2)*7+9 &".xlsm]Figures'!$D$6"
    or maybe

    ="[" & (row()-1)*7+9 &".xlsm]Figures'!$D$6"
    that would give you the increment in the workbook name (assuming you were pasting the 09.xlms file call in the A1 cell and the others below it...but w/o a workbook i have to assume some things

    Then, use indirect to finish it off (say in the B column??)

    ='S\11\october\INDIRECT(A2)
    pasted down?


    EDIT: dang...too slow... ah ha...indirect the whole dang thing nice didn't know that "TEXT()" trick there.
    Thanks 6SJ....your marklars are wise and true
    Last edited by GeneralDisarray; 10-11-2011 at 10:18 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    12-27-2008
    Location
    Christchurch, New Zealand
    Posts
    92

    Re: Copying formula

    1. Use a handy macro called INDIRECT.EXT

    I can't find this in the excel function list. Do I need to download an add-on?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,330

    Re: Copying formula

    Hi MikeNZ,

    6StringJazzer gave you a link in his #1 above that you need to click on to get to what he is suggesting.

    Or click on http://xcell05.free.fr/morefunc/engl...direct.ext.htm to go to the same place.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    12-27-2008
    Location
    Christchurch, New Zealand
    Posts
    92

    Re: Copying formula

    I clicked on that, read the info and inserted the formula but I get a #NAME error. In the list of functions I have in excel there is no indirect.ext so I presuming I need to download from the morefunc site?

+ 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