+ Reply to Thread
Results 1 to 12 of 12

How to add worksheet before another known worksheet that varies in location in file

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    How to add worksheet before another known worksheet that varies in location in file

    I have an excel file with many worksheet in this file. I have a "totals" worksheet which varies in location depending on who last viewed/used the file. What i want to do is add a new worksheet (called latest_month) so that this new worksheet is just prior to the "totals" worksheet. Does anyone know how to do this?

    I found this code to add a worksheet just prior to the last worksheet in the file.....but i have not been able to modify it to work for my situation.



    Please Login or Register  to view this content.
    Last edited by welchs101; 03-01-2012 at 10:47 AM.

  2. #2
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Hello here you go buddy, assign this to a button or to run on workbook open, this will seek out the Sheets called totals, drop one sheet back and insert your new sheet called Latest_Month.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Use this:
    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  4. #4
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: How to add worksheet before another known worksheet that varies in location in fi

    thanks for the information!

  5. #5
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Anytime dont forget to Give Rep Where it's Due.

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: How to add worksheet before another known worksheet that varies in location in fi

    i gave rep .........

  7. #7
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: How to add worksheet before another known worksheet that varies in location in fi

    You sure did and Thank You.
    Remember should you get stuck again, where here to Help!
    Like my post? Considered leaving Rep? Thanks.

  8. #8
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Quote Originally Posted by hensucker View Post
    Anytime dont forget to Give Rep Where it's Due.
    Rep is entirely voluntary, so please don't hassle people to do it.
    Good luck.

  9. #9
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Apologies to Welchs101 and the forum, strip my points.

  10. #10
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: How to add worksheet before another known worksheet that varies in location in fi

    i know this item is closed but i have one more question.

    The code suggested works fine.........but i have a question.

    If i have more than one workbook open how do i specify which workbook i want to add this worksheet into.

  11. #11
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: How to add worksheet before another known worksheet that varies in location in fi

    Well if this code is built into a module, that module would only be stored in the Workbook you have placed it in correct?
    Else you could try

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: How to add worksheet before another known worksheet that varies in location in fi

    thanks guys. that was it.

    no need to strip away pts from anyone.......thanks for the help!

+ 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