Results 1 to 8 of 8

Need a VB code to generate sheets from a list of cells

Threaded View

  1. #1
    Registered User
    Join Date
    08-04-2008
    Location
    Blackpool
    Posts
    22

    Need a VB code to generate sheets from a list of cells

    Hi, first post here, but have already used the site many times to help me compile a few spreadsheets for work...

    i am pretty poor with excel in comparrison to you guys, but am getting there slowly but surely

    I used this code from another thread, its used to generate worksheets with a specific name from a list...

    Sub copysht()
        Dim cl     As Range
        For Each cl In Sheet1.Range("A:A")
            Sheet2.Copy after:=Sheets(Worksheets.Count)
            ActiveSheet.Name = cl.Value
        Next cl
    End Sub
    So at present, its copying sheet 2 and naming them from sheet 1 column A, but i need two things additionally which i am not sure how to do...

    firstly, i need it to automatically stop when it runs out of names in the column A rather than generate an error when the list runs out.

    Secondly, i need it to operate in a "live" enviorment, so the second someone adds to the list it creates a new worksheet with the corresponding name, and also when a name on the list is deleted it deletes the corresponding worksheet.

    Any help much appreciated as its way beyond my capabilities!
    Last edited by dominicb; 08-06-2008 at 09:31 AM.

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