+ Reply to Thread
Results 1 to 4 of 4

Sheets.Add using other worksheet as "template"

  1. #1
    nicholas_chuah@yahoo.com
    Guest

    Sheets.Add using other worksheet as "template"

    Hi,

    I have a worksheet call MASTER

    In one of the macro which create new worksheets dynamically, I need to
    create the new worksheet using the worksheet MASTER.

    Part of the macro:

    dim ws_new as worksheet
    Set ws_new = Sheets.Add

    Sheets.Add just add empty worksheet, what is the right syntax to the
    above macro to use the MASTER worksheet?

    Nic


  2. #2
    Bob Phillips
    Guest

    Re: Sheets.Add using other worksheet as "template"

    Unlike workbooks, there is only one worksheet template, called Sheet.xlt,
    and stored in your XLStart directory. All new sheets will assume this
    template, although you can save a new template file if you wish.

    If you want multiples, you could store them in your Personal.xls file, and
    copy rather than just add.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <nicholas_chuah@yahoo.com> wrote in message
    news:1114453232.003271.63130@z14g2000cwz.googlegroups.com...
    > Hi,
    >
    > I have a worksheet call MASTER
    >
    > In one of the macro which create new worksheets dynamically, I need to
    > create the new worksheet using the worksheet MASTER.
    >
    > Part of the macro:
    >
    > dim ws_new as worksheet
    > Set ws_new = Sheets.Add
    >
    > Sheets.Add just add empty worksheet, what is the right syntax to the
    > above macro to use the MASTER worksheet?
    >
    > Nic
    >




  3. #3
    Jim Thomlinson
    Guest

    RE: Sheets.Add using other worksheet as "template"

    So do you want to make a copy of a sheet called master which already exists
    in your workbook? If so then...

    Public Sub CopyMaster()
    Dim wksMaster As Worksheet

    Set wksMaster = Sheets("Master")
    wksMaster.Copy Sheets(1)
    Set wksMaster = Nothing

    End Sub


    "nicholas_chuah@yahoo.com" wrote:

    > Hi,
    >
    > I have a worksheet call MASTER
    >
    > In one of the macro which create new worksheets dynamically, I need to
    > create the new worksheet using the worksheet MASTER.
    >
    > Part of the macro:
    >
    > dim ws_new as worksheet
    > Set ws_new = Sheets.Add
    >
    > Sheets.Add just add empty worksheet, what is the right syntax to the
    > above macro to use the MASTER worksheet?
    >
    > Nic
    >
    >


  4. #4
    Dave Peterson
    Guest

    Re: Sheets.Add using other worksheet as "template"

    Don't use "As Worksheet".

    Dim ws_new As Object
    Set ws_new = Sheets.Add(Type:="C:\my documents\excel\book1.xls")

    This adds as many sheets as there are in the master workbook.



    nicholas_chuah@yahoo.com wrote:
    >
    > Hi,
    >
    > I have a worksheet call MASTER
    >
    > In one of the macro which create new worksheets dynamically, I need to
    > create the new worksheet using the worksheet MASTER.
    >
    > Part of the macro:
    >
    > dim ws_new as worksheet
    > Set ws_new = Sheets.Add
    >
    > Sheets.Add just add empty worksheet, what is the right syntax to the
    > above macro to use the MASTER worksheet?
    >
    > Nic


    --

    Dave Peterson

+ 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