ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto duplicating a sheet (https://www.excelbanter.com/excel-programming/325339-re-auto-duplicating-sheet.html)

Jim Thomlinson[_3_]

Auto duplicating a sheet
 
Here is some really generic code that makes 42 copies of the current sheet.

Public Sub Duplicate()
Dim wks As Worksheet
Dim intCounter As Integer

Set wks = ActiveSheet
For intCounter = 1 To 42
wks.Copy , wks
Next intCounter
End Sub

You can place this code in a module (where code froma a recorded macro ends
up) and reference it the same as you would any macro...

HTH

"dvonj" wrote:

I have just completed working on a sheet and now need to make copies of it. I
know I can right click on the sheet tab and select copy however I need 42
sheets. Is there a way to program XL to create 42 copies of the worksheet. I
am not real familuar with VBE but with help can work through it.

Thanks



All times are GMT +1. The time now is 05:08 PM.

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