+ Reply to Thread
Results 1 to 12 of 12

Index sheet in a workbook

  1. #1
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Index sheet in a workbook

    Workbook functions almost need some help to finish. How it should work - Press a button and it adds a line in a spreadsheet in sequential order starting in A3 (got this part working). Then, another template sheet is selected copied and a new sheet is added and pastes the template (got this to work).

    Need help here after the new sheet is included, how do I make the new sheet name follow the sequence listed in the Index page and stay on the right of the index page?

    I have attached the workbook I am working on. Also, would like to thank this forum for getting me off the ground with all my VB needs. I have really enjoyed learning through this site!
    Attached Files Attached Files
    Last edited by Tortus; 11-05-2010 at 11:50 AM.

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Index sheet in a workbook

    I fixed up your Addsheet routine a bit. It picks up the item number from the index sheet and makes the name of the new sheet "Item" followed by this number. Also, the new sheet is added to the end of all of the worksheets.
    Please Login or Register  to view this content.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index sheet in a workbook

    you don't really need the Module1 code nor the Userform. Delete those and put this code into your CommandButton:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 11-04-2010 at 06:35 PM. Reason: sheet removed...see below for latest version
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: Index sheet in a workbook

    Thanks for the help - Its working except this part now.

    It is failing at this line for some reason.

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Index sheet in a workbook

    Jerry is right on. You have made this much more complicated than necessary. Another word of advice - avoind using .Select unless you really need to do it.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Index sheet in a workbook

    I can't see the problem with a UserForm
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: Index sheet in a workbook

    Roy - It is not adding anything to E and it is naming the new sheet whatever I put in the textbox1.

  8. #8
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: Index sheet in a workbook

    I got it to add the correct text in E - sPlan was misspelled, but the tab name is still whatever is in E now

  9. #9
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index sheet in a workbook

    My bad, on my version just fix this:
    Please Login or Register  to view this content.

    I've corrected the code and the original wrkbook I uploaded below.
    Last edited by JBeaucaire; 11-04-2010 at 06:36 PM.

  10. #10
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: Index sheet in a workbook

    Now that I see this it is good. Would be sweet if there were a way to hyperlink from the plan number to the plan tab!!?

  11. #11
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index sheet in a workbook

    Simple enough, hyperlink added:

    Please Login or Register  to view this content.

    You should probably add a hyperlink on your template sheet back to the INDEX so it's easy to click back and forth between sheets and the index.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: Index sheet in a workbook

    Thank you! Wish I knew what you knew.... maybe one day

+ 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