Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Copying the active worksheet to another worksheet in the same work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
queenmaam - 25 Mar 2008 19:13 GMT
I am recording a simple macro to insert a new worksheet and copy the content
of the active worksheet to it. Using the macro recorder, it works fine the
first time, but if I try to use the same macro to copy the second sheet (the
one just created) to a third sheet, it still copies from the original (first)
sheet. I can see why that happens, but I'm not sure how to rework the macro
to copy from the active sheet rather than from the original sheet.

The goal is to copy information from one week's sheet to create a sheet for
the next week for the duration of a project.
Betty H - 25 Mar 2008 19:29 GMT
I find that it is simpler to make an exact copy of the existing worksheet.  
To do this make the worksheet you want to copy the active worksheet, hold the
Ctrl button down while you click on the active worksheet tab and drag/drop it
next to it.  Then release the Ctrl button.  This creates an exact duplicate
of the active worksheet.

Signature

Betty H
Salem, OR

> I am recording a simple macro to insert a new worksheet and copy the content
> of the active worksheet to it. Using the macro recorder, it works fine the
[quoted text clipped - 5 lines]
> The goal is to copy information from one week's sheet to create a sheet for
> the next week for the duration of a project.
queenmaam - 25 Mar 2008 19:40 GMT
Thanks, Betty. I know I can do it that way, I'm just trying to automate it as
much as I can for others on my team.

> I find that it is simpler to make an exact copy of the existing worksheet.  
> To do this make the worksheet you want to copy the active worksheet, hold the
[quoted text clipped - 11 lines]
> > The goal is to copy information from one week's sheet to create a sheet for
> > the next week for the duration of a project.
ryguy7272 - 25 Mar 2008 19:35 GMT
Either post your code, or use this code (I think this will pretty much do
what you want):
http://www.rondebruin.nl/copy2.htm

Lots of other copy/paste/merge examples here:
http://www.rondebruin.nl/tips.htm

Regards,
Ryan---

Signature

RyGuy

> I am recording a simple macro to insert a new worksheet and copy the content
> of the active worksheet to it. Using the macro recorder, it works fine the
[quoted text clipped - 5 lines]
> The goal is to copy information from one week's sheet to create a sheet for
> the next week for the duration of a project.
queenmaam - 25 Mar 2008 19:39 GMT
Thanks. I figured it was pretty simple, but I'm very new at macros.

> Either post your code, or use this code (I think this will pretty much do
> what you want):
[quoted text clipped - 15 lines]
> > The goal is to copy information from one week's sheet to create a sheet for
> > the next week for the duration of a project.
Gord Dibben - 25 Mar 2008 19:56 GMT
I would say that the macro has the original sheet name hard-coded due to the
macro recorder steps.

Change any hard-coded name to Activesheet.

i.e.  original code  Sheets("Sheet1").cells.copy etc.

Change to ActiveSheet.cells.copy  etc.

Gord Dibben  MS Excel MVP

>I am recording a simple macro to insert a new worksheet and copy the content
>of the active worksheet to it. Using the macro recorder, it works fine the
[quoted text clipped - 5 lines]
>The goal is to copy information from one week's sheet to create a sheet for
>the next week for the duration of a project.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.