+ Reply to Thread
Results 1 to 13 of 13

How can I make copy worksheet from template worksheet?

  1. #1
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Red face How can I make copy worksheet from template worksheet?

    Hello,
    I explained my problem in detail in the attached file. To summarize briefly, there are two pages I used: "Sevk Listesi" and "Sablon". When I wrote new number in A column at "Sevk Listesi" worksheet, create a new worksheet from template worksheet "Sablon" and rename worksheet according to the numbers. For example the numbers 1, 2, 3 and worksheet names 1, 2, 3 etc. I hope explained my problem detailly.

    Thank you in advance that will help my friends.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Could you help me somebody please?

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How can I make copy worksheet from template worksheet?

    I have a question - will only 1 number be added at a time in column A? Do you want the user to enter the number and then click on a button so that a tab is created?

  4. #4
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    the system work as follows:
    1- The user fill the numbers in the column A at the page "Sevk Listesi" (main page). For example 1,2,3 etc.
    2- Run the macro by user with button, macro copied new pages from "Sablon" page and renamed all copied pages. Page names same as column A at the page "Sevk Listesi". Like 1,2,3 etc.

    Hopefully i can explain. Sorry my bad english :D .

  5. #5
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Could you help me somebody please?
    Quote Originally Posted by blckwolf View Post
    the system work as follows:
    1- The user fill the numbers in the column A at the page "Sevk Listesi" (main page). For example 1,2,3 etc.
    2- Run the macro by user with button, macro copied new pages from "Sablon" page and renamed all copied pages. Page names same as column A at the page "Sevk Listesi". Like 1,2,3 etc.

    Hopefully i can explain. Sorry my bad english :D .

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How can I make copy worksheet from template worksheet?

    I have another question. Suppose today the user enters numbers 1, 2 and 3, so 3 sheets will be added and the sheets renamed.

    However, tomorrow once the user again enters numbers 4, 5 and 6, should the macro be checking if the sheets of the previous day have already been added? Can a column be inserted which will have a tick mark that the sheet has already been copied?

  7. #7
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Yes, you are right, if the new pages does not exist on the list => macro will be run. If the pages exist, macro can not run. So, macro to be control the entered page numbers already been copied.

    Quote Originally Posted by arlu1201 View Post
    I have another question. Suppose today the user enters numbers 1, 2 and 3, so 3 sheets will be added and the sheets renamed.

    However, tomorrow once the user again enters numbers 4, 5 and 6, should the macro be checking if the sheets of the previous day have already been added? Can a column be inserted which will have a tick mark that the sheet has already been copied?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How can I make copy worksheet from template worksheet?

    Try this out -
    Please Login or Register  to view this content.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How can I make copy worksheet from template worksheet?

    Please do not quote (see the forum rules)

    Please Login or Register  to view this content.
    Last edited by snb; 10-25-2011 at 03:29 PM.



  10. #10
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Dear arlu1201

    Thank you very much for your interesting.

    Dear snb

    Sorry for if i do quote. Thank you for understanding.

  11. #11
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Dear arlu1201

    I thank you before for your below code. The code is good working until 60th page, macro does not open more than 60 pages. How can i correct it? Is the 60 pages upper limit?

    Quote Originally Posted by arlu1201 View Post
    Try this out -
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    Could you help me somebody please?
    Quote Originally Posted by blckwolf View Post
    Dear arlu1201

    I thank you before for your below code. The code is good working until 60th page, macro does not open more than 60 pages. How can i correct it? Is the 60 pages upper limit?

  13. #13
    Registered User
    Join Date
    09-22-2007
    Posts
    19

    Re: How can I make copy worksheet from template worksheet?

    I do not want to quote, but i can not solve the problem. I can not copy more than 60 pages with this code. Could you help me somebody for solve the problem?

    Sub create_sheet()

    Dim blnfound As Boolean
    Dim i As Integer
    Dim ws As Object
    Dim strListSheet As String: strListSheet = "Sevk Listesi" 'The name of the sheet that has the list.

    For i = 2 To Sheets(strListSheet).Cells(Rows.Count, 1).End(xlUp).Row
    blnfound = False
    For Each ws In ThisWorkbook.Worksheets
    If UCase(ws.Name) = UCase(CStr(Sheets(strListSheet).Cells(i, 1).Value)) Then blnfound = True
    Next ws
    If blnfound = False Then
    Sheets("Sablon").Copy After:=Sheets(Worksheets.Count)
    ActiveSheet.Name = Sheets(strListSheet).Cells(i, 1).Value
    End If
    Next i

    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.6.0 RC 1