+ Reply to Thread
Results 1 to 4 of 4

Referencing Non-Existent Worksheets

  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    12

    Question Referencing Non-Existent Worksheets

    This may be a bit hard to explain so please bare with me.

    As you can see from below, I have a 'ROLL UP' worksheet at the end of my excel which gathers all of the data from the previous worksheets into 1 summary page

    Project1
    Name Time Pay
    John 2h $30

    Project2
    Name Time Pay
    Sam 3h $40

    Project3
    Name Time Pay
    Tim 1h $25

    ROLL UP
    Name Time Pay
    John 2h $30
    Sam 3h $40
    Tim 1h $25

    _________________________________________________________________________________________________________________

    Here is the jist of the problem. This is a working document and I do not know how many projects there will be at the end. So, I created a macro which when clicked, will generate a clean project worksheet for the individual to fill out. So when they have another project completed, they click the button, and it will automatically create Project4, Project5, ETC.... (These are all new worksheets within the same excel file)

    HOWEVER, how to do I automatically have my roll up page detect new sheets as they are created?

    __________________________________________________________________________________________________________________

    My idea was to have write ='Project4'!A1 (which will error, because Project4 doesn't exist)

    Then when the user clicks the add new worksheet button, a Project4 page will be created and the roll up page will then see it, and un-error.

    This does not seem to work however. Even though the new tab created matches the name, the page will not recalculate. I added a force recalculate line into the create page button macro but it will still not work.

    I hope this makes sense...



    THANKS!!!!!!!!

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Referencing Non-Existent Worksheets

    Try this

    Paste you code that is collecting the data where it says "do you code here"

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    07-27-2011
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Referencing Non-Existent Worksheets

    Hi -

    Thanks, but this is not quite working. I want to reference a worksheet that does not exist, so if the user enters a new tab and calls it "project4," my other sheet can reference it. It would be great if it works in an equation, rather than VBA.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Referencing Non-Existent Worksheets

    With Project4 in A1, =iferror(indirect(A1 & "!A1"), "")
    Entia non sunt multiplicanda sine necessitate

+ 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