+ Reply to Thread
Results 1 to 12 of 12

I want to copy a formula across 52 worksheets that relates to the same cell in each sheet

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    Lancashire, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    I want to copy a formula across 52 worksheets that relates to the same cell in each sheet

    Hi, hope someone can help.

    I have a master worksheet plus 52 identical worksheets (one for each week). On the master worksheet in cell A1 I have a formula that relates to Sheet2A1. In Cell B1 I have a formula that relates to Sheet3A1 etc all the way through to Sheet52 A1. I could manually input all these but is there a simple way of dragging?/ copying the formula across the master worksheet.

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

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    You could put this in the master worksheet A1 then fill to the right:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    Lancashire, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    Thanks for your response Jeff, I have failed, not for the first time...probably cos I haven't explained it well enough.

    The actual cell reference in sheets 1-52 is G17, what should the above formula look like on the master sheet using your above example. The sheets are named 1,2,3,4 etc up to 52

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    So cell A1 will refer to Sheet1, rather than Sheet2 as in the original example. Also, the cell reference will be G17 rather than A1. So the formula changes to

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    INDIRECT is a function that creates a range reference based on a string given as an argument. COLUMN returns the column number of the current cell. So when this formula is in A1, it will evaluate as

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which will be equivalent to using

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hopefully that helps explain how this works and what I changed based on your latest update.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    6String's got it pretty much right.
    Except...
    Quote Originally Posted by bbonzo View Post
    The sheets are named 1,2,3,4 etc up to 52
    This =INDIRECT("Sheet"&COLUMN()&"!G17") will be referring to Sheet1 Sheet2 Sheet3
    But I suppose you actually want just 1 2 3

    Should be
    =INDIRECT(COLUMN()&"!G17")

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    Unqualified ROW() and COLUMN() references are not the most rigorous options available:

    http://excelxor.com/2014/08/25/row-v...er-generation/

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Registered User
    Join Date
    07-26-2013
    Location
    Lancashire, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    Jonmo, do I need to put a cell reference in the brackets following COLUMN? The formula works for the first sheet, as it would, but doesn't work when I drag the formula across on the master sheet, it stays as reference to Sheet 1 rather than Sheets 2, 3,4 etc.

    Thanks for all your responses, I am sure you could all solve this query quickly if you sat at my desk!!

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    As Column() is dragged right, it's returning the # corresponding to the column the formula is entered in.

    So in A1, Column() = 1
    Dragged right to B1, Column() = 2
    to C1, Column()=3
    Etc..

    but Xor is right, it's best to include an actual reference.
    And I honestly prefer columnS over column..

    Try
    =INDIRECT(COLUMNS($A:A)&"!G17")

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    Precisely. COLUMNS and ROWS should always be preferred over COLUMN and ROW in these types of construction.

    Regards

  10. #10
    Registered User
    Join Date
    07-26-2013
    Location
    Lancashire, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    It works! Many thanks to all who replied. Relief.

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    You're welcome.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: I want to copy a formula across 52 worksheets that relates to the same cell in each sh

    I overlooked the sheet names being just numbers, sorry about that.

    Just for the sake of closure I agree in principle with the points made by Jonmo1 and XOR LX. The rationale is that using cells references and COLUMNS you avoid a dependency on specifically which columns the formulas fall in. In this case I took a bit of a shortcut, taking advantage of the fact that the first item fell in column A. That solution is simple but not very portable or robust against changes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy row if cell value equals string - All worksheets in book to new sheet
    By psl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 11:27 AM
  2. [SOLVED] Macro to copy cell contents from the Header sheet into cell A2 on all worksheets
    By jsantos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2012, 06:28 PM
  3. Copy defined cell from various worksheets to new sheet (Index sheet)
    By kookao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2011, 03:55 PM
  4. Replies: 2
    Last Post: 11-09-2010, 12:37 PM
  5. Replies: 1
    Last Post: 05-15-2005, 08:06 PM

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