+ Reply to Thread
Results 1 to 8 of 8

Automatic naming of tabs?

  1. #1
    Registered User
    Join Date
    08-25-2006
    Posts
    3

    Automatic naming of tabs?

    I am building a worksheet for paying vendors for my company. Upon receiving a small batch of bills, I'll open a workbook that has several identical blank forms. For each bill, I'll fill-out one sheet within the workbook using a drop down list to insert the vendor's name/address. Then I'll fill in the the dollar amount of the bill.

    Now my question: Once a vendor is chosen, is there a way for the generic worksheet to have the tab automatically filled-in to match the vendor's name. Is this possible? I'm a noob to VBA, so if that is necessary, I'll be struggling to understand.

    Thanks for any help you can offer.

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Copy this code and paste it into the Sheet object in the visual basic editor. To get there right click on the sheet tab and select view code. ONce there paste this code in. When you change the value of cell A1 the worksheet tab name changes. You can adjust the cell that changes the worksheet name by changing the red text in the code to the cell value you want with the $ included.

    Please Login or Register  to view this content.
    Last edited by Excelenator; 08-31-2006 at 10:29 AM.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Registered User
    Join Date
    08-25-2006
    Posts
    3
    Thanks, that worked great. It popped in the word "New" before the name, so I deleted that from the code and it appears to still work fine.


    And one other question to anyone who sees this. Where is the best place on this forum to start learning lots more about the visual basic editor?

  4. #4
    Registered User
    Join Date
    09-06-2004
    Posts
    37
    Quote Originally Posted by Excel Query
    And one other question to anyone who sees this. Where is the best place on this forum to start learning lots more about the visual basic editor?
    The Excel Programming forum would probably the best place to start.

  5. #5
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    Quote Originally Posted by Excel Query
    And one other question to anyone who sees this. Where is the best place on this forum to start learning lots more about the visual basic editor?
    and of course from me

  6. #6
    Registered User
    Join Date
    08-25-2006
    Posts
    3
    Excelenator,
    The code works great, but stops working if the sheet is saved. What can I change on the code so it continues to work?


    BTW, thanks Mark, thanks funky.

  7. #7
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Microsoft Press

    I purchased a couple of books several years ago from Microsoft Press.

    Both started bery basic and worked through to quite a bit more advanced.

    Microsoft Excel97 Step by Step - came with a floppy with practice files to go along with the tutorials in the book.

    Microsoft Excel97 Visual Basic Step by Step - Came with a CD with practice files to go along with the tutorials in the book.

    I haven't looked recently, but I am sure they have somnething similar for today's products.

    Quote Originally Posted by Mark K
    The Excel Programming forum would probably the best place to start.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  8. #8
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    If you are Self Starting

    http://www.microsoft.com/MSPress/books/5163.asp

    Quote Originally Posted by Excel Query
    Thanks, that worked great. It popped in the word "New" before the name, so I deleted that from the code and it appears to still work fine.


    And one other question to anyone who sees this. Where is the best place on this forum to start learning lots more about the visual basic editor?

+ 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