What code are you using at the moment? I suspect you are referring to the activesheet when copying. Try this
Option Explicit
Private Sub CommandButton1_Click()
'---------------------------------------------------------------------------------------
' Module : Sheet3
' DateTime : 08/02/2007 08:08
' Author : Roy Cox (royUK)
' Website : more examples
' Purpose : Add a sheet based on a hidden Main sheet into a specific position in the workbook
' Disclaimer; This code is offered as is with no guarantees. You may use it in your
' projects but please leave this header intact.
'---------------------------------------------------------------------------------------
Dim iWsCnt As Integer
iWsCnt = ThisWorkbook.Worksheets.Count
'hide operation from user
Application.ScreenUpdating = False
With ThisWorkbook.Worksheets("Main")
.Visible = xlSheetVisible
Select Case _
MsgBox("Click Yes to position the new sheet immediately before this one." _
& vbNewLine & vbNewLine & _
"Click No to place the new sheet at the end.", vbYesNo Or vbQuestion _
Or vbDefaultButton1, "Add extra sheet")
Case vbYes
' add a sheet before the active sheet
.Copy before:=ActiveSheet
Case vbNo
'add a sheet as last sheet
.Copy after:=Worksheets(iWsCnt)
End Select
'name the new sheet
ActiveSheet.Name = "Page" & iWsCnt - 1 'you may need to change 1 according to the number of sheets not named page
.Visible = xlSheetVeryHidden
End With
Application.ScreenUpdating = True
End Sub
Bookmarks