Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Copying the active worksheet to another worksheet in the same work

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Copying the active worksheet to another worksheet in the same work

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.


--
Betty H
Salem, OR


"queenmaam" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Copying the active worksheet to another worksheet in the same work

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 he
http://www.rondebruin.nl/tips.htm


Regards,
Ryan---

--
RyGuy


"queenmaam" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Copying the active worksheet to another worksheet in the same

Thanks. I figured it was pretty simple, but I'm very new at macros.

"ryguy7272" wrote:

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 he
http://www.rondebruin.nl/tips.htm


Regards,
Ryan---

--
RyGuy


"queenmaam" wrote:

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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Copying the active worksheet to another worksheet in the same

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.

"Betty H" wrote:

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.


--
Betty H
Salem, OR


"queenmaam" wrote:

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.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Copying the active worksheet to another worksheet in the same work

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

On Tue, 25 Mar 2008 11:13:02 -0700, queenmaam
wrote:

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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying a formula from one worksheet to another worksheet Kathie Excel Worksheet Functions 1 May 24th 07 01:31 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Excel Discussion (Misc queries) 2 December 10th 06 06:02 AM
Copying a worksheet witrh protected cells to a new worksheet John Excel Worksheet Functions 2 February 1st 06 02:19 PM
Copying all formats from worksheet to worksheet Gary Excel Worksheet Functions 1 January 11th 06 05:18 PM
copying formulas from worksheet to worksheet yesbob Excel Discussion (Misc queries) 1 February 7th 05 02:25 AM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"