ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to copy existing sheet to end (https://www.excelbanter.com/excel-programming/431306-macro-copy-existing-sheet-end.html)

Steve

Macro to copy existing sheet to end
 
I am creating a macro to make several copies of a particular worksheet and
move each succeeding one to the end (a choice when doing it manually).
However the macro recorder shows this
Sheets("1").Copy After:=Sheets(8)
How can I generically make the "After:=Sheets(8)" into "After:=End"?

John

Macro to copy existing sheet to end
 
try this.

Sheets(1).Copy After:=Worksheets(Worksheets.Count)
--
jb


"Steve" wrote:

I am creating a macro to make several copies of a particular worksheet and
move each succeeding one to the end (a choice when doing it manually).
However the macro recorder shows this
Sheets("1").Copy After:=Sheets(8)
How can I generically make the "After:=Sheets(8)" into "After:=End"?


JLGWhiz[_2_]

Macro to copy existing sheet to end
 
Just in case there are chart or template sheets:

Sheets(1).Copy After:=Sheets(Sheets.Count)



"john" wrote in message
...
try this.

Sheets(1).Copy After:=Worksheets(Worksheets.Count)
--
jb


"Steve" wrote:

I am creating a macro to make several copies of a particular worksheet
and
move each succeeding one to the end (a choice when doing it manually).
However the macro recorder shows this
Sheets("1").Copy After:=Sheets(8)
How can I generically make the "After:=Sheets(8)" into "After:=End"?





All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com