+ Reply to Thread
Results 1 to 8 of 8

Multiple open workbooks pulling their names!?

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Multiple open workbooks pulling their names!?

    Hi, thanks to help I've received on this board I've been able to make an attendance sheet at work that has the ability to carry numbers forward from sheet to sheet. Each sheet is named according to a period of time, and it will look at it's own filename, and figure out what the previous file is, and then get the number from the previous file.

    It works right now but the problem is that when using the =cell("filename") formula it only looks at the active workbook, which means you can't open more than one at a time. I want to make it a little bit more user friendly so I've made some code that will pull the filename which seems to work. The problem is that the filename doesn't automatically update when a new workbook is made. I have a template file that I copy and rename each week and I need the cell with the filename to automatically update whenever I open the workbook.

    So basically, I need code that will make a cell recalculate upon opening the workbook. I've gotten some suggestions on this site before but they never seemed to work.

    If anybody can help that would be awesome.

    Thanks!
    Last edited by The Phil; 09-02-2010 at 06:48 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Multiple open workbooks pulling their names!?

    Hello The Phil,

    Posting your workbook would go a long way in helping us to help you.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Multiple open workbooks pulling their names!?

    In this workbook you will see that opening the file will have cell D13 saying "Test2" which is what the filename used to be. I need it to automatically update to the new filename upon opening it. I also want to be able to have multiple workbooks open so they can't look at the active workbook.

    There is a code in the openworkbook part that someone suggested on this forum but it doesn't seem to work.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Multiple open workbooks pulling their names!?

    Hello Phil,

    Do you want to increment the file name by one? The current file is "Test2". Do you want the next file to be "Test3"? Will this be a new workbook or an existing workbook?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Multiple open workbooks pulling their names!?

    Hello Phil,

    If I understand what you want then will correct the problem.

    Remove the Class Module, delete the code in Module1, and paste the macro below back into Module1 and save it. This will show the workbook's name on opening in cell D13.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Multiple open workbooks pulling their names!?

    Sorry for not getting back sooner, I was off the last couple days.

    I tried the code as you suggested and it still opens with the last filename in cell D13. I attached my file for you to see.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Multiple open workbooks pulling their names!?

    Somehow I got it to work. I added a more specific reference to the openworkbook part that included the sheet name, and I used your code, and after fiddling around with it it started working. The odd thing is that when I try to hit alt F11 I can't see the code anywhere? But is works still...? I dunno what happened but oh well.

  8. #8
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Multiple open workbooks pulling their names!?

    I realize this is already sloved but this workbook may help someone in the future. It allows for the selection of all open workbooks from a combo box. Then once the workbook is selected, it lists the sheets of that workbook in another combo box. The rest of the work but doesn't pertain to this post but someone may find it usefull.

    Mark
    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)

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