+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    09-24-2009
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2007
    Posts
    1

    Creating worksheets depending on cells on a worksheet

    Hi,

    I am trying to create worksheets and naming them automatically depending on the name you input in various cells in another worksheet... For example:

    In worksheet 1, i have cells A1, A2, A3, A4, A5, ....
    If I input "costs" in cell A1, then it will create a new worksheet called "costs".
    If I then also input "income" in cell A2, it will also create a new worksheet after the "costs" worksheet called "income".
    And so on...

    Does anyone know a simple way of doing this?

    Any help appreciated...

    Thanks!

    E.

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717

    Re: Creating worksheets depending on cells on a worksheet

    sample code for the same

    Code:
    Sub create_sheets()
        Cells(1, 1).Activate
        Set cur = ActiveCell.CurrentRegion
        For Each xcell In cur
            Worksheets.Add
            ActiveSheet.Name = xcell
        Next xcell
    End Sub

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0