+ Reply to Thread
Results 1 to 8 of 8

Newly Created Sheets Replacing Existing

  1. #1
    Registered User
    Join Date
    05-19-2008
    Posts
    16

    Newly Created Sheets Replacing Existing

    I have a novice question...

    How would I create a macro that copies a template and creates a new sheet from it? I have the basics down, but the template has values that carry through to the copies, thus creating duplicates. How would I specify to copy the values only, and not the code?
    ____________________________________
    Please Login or Register  to view this content.
    ______________________________________________________
    Last edited by rylo; 05-19-2008 at 11:23 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525
    try
    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    A Template sheet you only contain Text, Formatting & formulas redy for input. So you need to clear out any values from a template sheet before using i & keeping it only as a template.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-19-2008
    Posts
    16
    Jindon,

    I am trying to use your code but am getting an error on this line;

    Set NewWs = Sheets.Add After:=Sheets(3)

    I changed it slightly to auto name the new sheet from a designated cell.


    Please Login or Register  to view this content.


    Any ideas on what I am doing wrong?
    Last edited by degmania; 05-20-2008 at 11:48 AM.

  5. #5
    Registered User
    Join Date
    05-19-2008
    Posts
    16

    Creating Copy of Sheet, Values Only

    So the goal is to set up a macro that copies the template sheet and adds it to the end. I would like it to copy only the values of the template and then auto name from a designated cell. Here is what I have so far;

    I get a syntax error at Set NewWs = Sheets.Add After:=Sheets(3)
    I would appreciate any help or suggestions!

    Please Login or Register  to view this content.
    Last edited by degmania; 05-20-2008 at 01:06 PM.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe change to

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  7. #7
    Registered User
    Join Date
    05-19-2008
    Posts
    16
    Thank you for the help. I have it working now.

  8. #8
    Registered User
    Join Date
    05-19-2008
    Posts
    16
    Issue Resolved

+ 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