Forum Discussion

Victoria_Oakman's avatar
Victoria_Oakman
Copper Contributor
Jan 23, 2023
Solved

Automatically update formulas/ VBA

I am trying to find a way in which I can add a new worksheet each month or every two months, to a workbook, and the formulas will automatically update to the previous worksheet. For example I have...
  • mathetes's avatar
    mathetes
    Jan 23, 2023

    Victoria_Oakman 

     

    Thank you. That helps. I still have another question or two.

     

    1. I gather there are multiple formulas that need to be able to be modified each month, not just the single formula that you're displaying; is that correct?
    2. Did you take a look at the INDIRECT function via the hyperlink provided? If so, did it seem at all relevant? (See below; I've created a file to demonstrate how that might work, if I've understood your need accurately.) 
    3. If INDIRECT doesn't work, or if you want further help, since that screen shot is of a workbook that does exist, I'm hoping you'd be willing to post a copy of the actual workbook on OneDrive or GoogleDrive, followed by pasting a link here in the forum granting edit access. That is the best way to help us (me and any others here who seek to answer questions such as yours) help you. Otherwise, we'd need to re-create a semblance of what you've got, which would never be quite as accurate or complete as the real thing.

    On the chance that INDIRECT will do for you what you want, I'm attaching (below this message box) a sample of a workbook with four tabs in it, with each of the three that follow "Master" using INDIRECT to subtract that period's number from the starting number in the previous sheet. They do so by means of INDIRECT which references cell J2, off to the side, where I place the name of the previous tab. Note, by the way, that I use an underscore connecting the month name with the year (rather than a space). Here's a screen shot for what is in May_2023, which references Mar_2023 by means of INDIRECT and the reference in cell J2.

     

Resources