Solved: EXCEL: copy sheet to another sheet

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 
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"
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top