+ Reply to Thread
Results 1 to 5 of 5

Thread: creating tabbed worksheet automatically

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18

    creating tabbed worksheet automatically

    I have a column like this

    ID

    1100
    1101
    1102
    1103
    .
    .
    .
    1299

    and I would like to make a tabbed worksheet for each entry with its ID instead of making this manually which takes ages

  2. #2
    Valued Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    510
    Hi mammut89,

    Use the next macro to insert the sheets. The macro assumes the sheetnames are in range B.

    Sub InsertSheets()
    
    Dim vCell As Variant
    
        i = Cells(Cells.Rows.Count, "B").End(xlUp).Row
        
        For Each vCell In Range("B1:B" & i)
            Sheets.Add.Name = vCell.Value
        Next vCell
    
    End Sub
    Success,
    Erik
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    excellent!

    thanks mate

  4. #4
    Registered User
    Join Date
    07-02-2008
    Location
    oslo
    Posts
    18
    hm.. I have to do one last thing . and that is to put each row into the belonging ID tabed worksheet

    I think I have to solve this with VBA too and im not so good at it.

    thought I could solve it easier.
    Attached Images Attached Images
    Last edited by mammut89; 07-04-2008 at 07:10 AM.

  5. #5
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777
    Maybe like this:
    Sub InsertSheets()
        Dim cell As Range
        
        For Each cell In Range("A2", Cells(Rows.Count, "A").End(xlUp))
            Sheets.Add After:=Sheets(Sheets.Count)
            ActiveSheet.Name = cell.Value
            cell.EntireRow.Copy Range("A1")
        Next cell
    End Sub

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