1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: EXCEL: copy sheet to another sheet

Discussion in 'Business Applications' started by sk0101, Sep 25, 2008.

Thread Status:
Not open for further replies.
  1. sk0101

    sk0101 Thread Starter

    Joined:
    Nov 8, 2007
    Messages:
    277
    Hi,

    I want to copy the original sheet into another sheet.

    I have sheet1 tab.

    if I use this code:
    ActiveWorkbook.Sheets("Sheet1").Copy after:=ActiveWorkbook.Sheets("Sheet1")

    it created sheet1(2). but I want to specify my tab name.

    if I chnage it and run:
    ActiveWorkbook.Sheets("Sheet1").Copy after:=ActiveWorkbook.Sheets("helloworld")

    It fails.. error comes up.

    How do I make it work?

    Thank you
     
  2. Yorkshire Guy

    Yorkshire Guy

    Joined:
    Dec 9, 2003
    Messages:
    563
    Hi sk0101,

    rename it after copying:-

    ActiveWorkbook.Sheets("sheet1 (2)").Name = "helloworld"

    lol
     
  3. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    Rename after copying is correct. But you'll find that the added sheet is active by default. So for less procedure calls, you can just use:

    Sheets("Sheet1").Copy After:=Sheets("Sheet1")
    ActiveSheet.Name = "helloworld"
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/753224

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice