ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a Sheet (https://www.excelbanter.com/excel-programming/335820-copy-sheet.html)

Judd Jones[_2_]

Copy a Sheet
 
I am trying to use the following code to copy a master sheet after the last
sheet in the workbook.

Sheets("master").Select
Sheets("master").Copy After:=Sheets(6)

The last part of the above is giving me the trouble. What should the After:=
statement be?

Tom Ogilvy

Copy a Sheet
 
Sheets("master").Copy After:=Sheets(Sheets.count)

--
Regards,
Tom Ogilvy

"Judd Jones" wrote in message
...
I am trying to use the following code to copy a master sheet after the

last
sheet in the workbook.

Sheets("master").Select
Sheets("master").Copy After:=Sheets(6)

The last part of the above is giving me the trouble. What should the

After:=
statement be?




Judd Jones[_2_]

Copy a Sheet
 
How about a message box to rename the sheet that is created?

"Tom Ogilvy" wrote:

Sheets("master").Copy After:=Sheets(Sheets.count)

--
Regards,
Tom Ogilvy

"Judd Jones" wrote in message
...
I am trying to use the following code to copy a master sheet after the

last
sheet in the workbook.

Sheets("master").Select
Sheets("master").Copy After:=Sheets(6)

The last part of the above is giving me the trouble. What should the

After:=
statement be?





Jef Gorbach

Copy a Sheet
 

"Judd Jones" wrote in message
...
I am trying to use the following code to copy a master sheet after the

last
sheet in the workbook.

Sheets("master").Select
Sheets("master").Copy After:=Sheets(6)

The last part of the above is giving me the trouble. What should the

After:=
statement be?


Sheets("Master").Copy After:=Sheets(Sheets.Count) 'copy it
Sheets(Sheets.Count).Name = "Master-2" 'rename it
something useful




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

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