+ Reply to Thread
Results 1 to 10 of 10

Help with formula across sheets.

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Help with formula across sheets.

    Hello all,

    I am trying to use a formula that references the prior sheet. I was wondering if anyone can help me figure out how to do this without going into each sheet individually. This is VERY time consuming and I am sure there is a quicker way. I just have been unable to figure it out. When ever I try to select all sheets and put the formula in, It just references sheet 1. I need it to reference the prior sheet. I also need sheet 1 on reference the last sheet in the next row.

    Please see example workbook.




    Any help is greatly appreciated.

    Thank you in advance!

    -John
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Help with formula across sheets.

    If this is a one-off then here is a way to do this.

    Set up sheet 2 the way you need it. Then make as many copies of this sheet as you need. Then go to each sheet and select a cell.

    Press CTRL_H to bring up the Find and Replace dialog box.

    In the find box type Sheet 2 Name (whatever it is). In the Replace with box type Sheet 3 Name. Click on Replace All.

    When you go to the next sheet and click on CTRL-H, these two fields will still be "in memory" - edit the Replace with field. Lather - Rinse - Repeat.

    If you have to do this repeatedly, then I'd record a macro and modify it.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Help with formula across sheets.

    Quote Originally Posted by dflak View Post
    If this is a one-off then here is a way to do this.

    Set up sheet 2 the way you need it. Then make as many copies of this sheet as you need. Then go to each sheet and select a cell.

    Press CTRL_H to bring up the Find and Replace dialog box.

    In the find box type Sheet 2 Name (whatever it is). In the Replace with box type Sheet 3 Name. Click on Replace All.

    When you go to the next sheet and click on CTRL-H, these two fields will still be "in memory" - edit the Replace with field. Lather - Rinse - Repeat.

    If you have to do this repeatedly, then I'd record a macro and modify it.


    Thanks for the reply!

    I am not real familiar with Macros and was thinking that was what was needed. This is a task that is done regularly and sometimes 40-50 sheets are required which is what makes this task so daunting. I will try this solution tomorrow when I get to work.

    Thank you!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Help with formula across sheets.

    OK, I recorded said macro and modified it. There is a bit of code you will have to modify and I will highlight what it is. What this macro does is take the "template" sheet - in this case Sheet2 and makes a copy of it at the end of the workbook. It gets, the previous sheet's name and substitutes the String to replace - in this case "Sheet1" with the previous sheet name.

    Here is the code. What you have to change is highlighted in red
    Please Login or Register  to view this content.
    In the attached workbook, this macro is linked to CTRL-S.

    You will wind up with a series of sheets like Sheet2(2), Sheet2(3), etc. that you will have to rename manually unless you can tell me that there is a way to name the sheet by its position in the book (E.g. Month and Year) in which case, I can rename the sheets as I go along.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45
    Thank you for your efforts! I will give this a shot. Just as a FYI, the sheet names are always different based on the task so I will have to name them.



    Quote Originally Posted by dflak View Post
    OK, I recorded said macro and modified it. There is a bit of code you will have to modify and I will highlight what it is. What this macro does is take the "template" sheet - in this case Sheet2 and makes a copy of it at the end of the workbook. It gets, the previous sheet's name and substitutes the String to replace - in this case "Sheet1" with the previous sheet name.

    Here is the code. What you have to change is highlighted in red
    Please Login or Register  to view this content.
    In the attached workbook, this macro is linked to CTRL-S.

    You will wind up with a series of sheets like Sheet2(2), Sheet2(3), etc. that you will have to rename manually unless you can tell me that there is a way to name the sheet by its position in the book (E.g. Month and Year) in which case, I can rename the sheets as I go along.

  6. #6
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Help with formula across sheets.

    Quote Originally Posted by dflak View Post
    OK, I recorded said macro and modified it. There is a bit of code you will have to modify and I will highlight what it is. What this macro does is take the "template" sheet - in this case Sheet2 and makes a copy of it at the end of the workbook. It gets, the previous sheet's name and substitutes the String to replace - in this case "Sheet1" with the previous sheet name.

    Here is the code. What you have to change is highlighted in red
    Please Login or Register  to view this content.
    In the attached workbook, this macro is linked to CTRL-S.

    You will wind up with a series of sheets like Sheet2(2), Sheet2(3), etc. that you will have to rename manually unless you can tell me that there is a way to name the sheet by its position in the book (E.g. Month and Year) in which case, I can rename the sheets as I go along.

    I am getting the sheet to add with the macro but the number is coming back s REF. I have attacked a workbook for you to see.

    Thank you!
    Attached Files Attached Files

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Help with formula across sheets.

    I don't seem to be able to replicate the issue.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-26-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Help with formula across sheets.

    Quote Originally Posted by dflak View Post
    I don't seem to be able to replicate the issue.
    Could it have to do with the name of the file? It might be because it's a macro and I am getting rejected through security.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Help with formula across sheets.

    @mechjo
    please don't quote entire posts unnecessarily. They are just clutter and make threads hard to read.
    Use the "Quick reply" instead
    Thanks

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Help with formula across sheets.

    The name of the file should not matter. Only sheet names should matter.

    If you have your security set not to run macros then it's not going to run at all.

    About the only thing I can see that would interfere with the way the macro runs is if the workbook is protected.

    In the attached, I changed the line of code that detects whether the sheet name needs to be "quoted" in the formula to be understood. Maybe that will make a difference for you.
    Attached Files Attached Files

+ 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] Google Sheets: Need help with "Is Not Equal To" formula over two sheets.
    By Peaceful Jim in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 16
    Last Post: 03-06-2018, 08:30 PM
  2. Formula to sum cells across multiple sheets or future sheets
    By dLhx in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-13-2017, 02:46 PM
  3. Replies: 1
    Last Post: 02-12-2014, 01:49 AM
  4. Replies: 0
    Last Post: 05-09-2013, 10:19 AM
  5. Replies: 0
    Last Post: 03-13-2013, 12:25 PM
  6. [SOLVED] I want to create a formula in one sheet, that will function as a formula in other sheets
    By johnw993 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2013, 07:07 PM
  7. Replies: 6
    Last Post: 03-30-2012, 11:25 AM

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